realzone22/laravel-query-gate 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

realzone22/laravel-query-gate

最新稳定版本:1.2.0

Composer 安装命令:

composer require realzone22/laravel-query-gate

包简介

Generic HTTP gateway for Laravel Eloquent queries.

README 文档

README

Latest Version Tests Total Downloads License

A lightweight, declarative API builder for Laravel with API versioning, standalone actions, frontend SDK, and zero boilerplate.

Modified version of Laravel Query Gate

Added Features

  • Standalone Actions: Create model-free endpoints for custom logic.
  • Rate Limiting: Built-in support for rate limiting on API endpoints.
  • Swagger UI Fix: Fixed Swagger UI

Why Query Gate?

FeatureQuery GateLaravel Orion
API Versioning✅ Built-in (Header-based)
Standalone Actions✅ Model-free endpoints
Open API
Laravel 10+
Zero Config⚠️

Quick Start

use BehindSolution\LaravelQueryGate\Traits\HasQueryGate;

class User extends Model
{
    use HasQueryGate;
    
    public static function queryGate(): QueryGate
    {
        return QueryGate::make()
            ->filters(['name' => 'string', 'email' => 'email'])
            ->allowedFilters(['name' => ['like'], 'email' => ['eq']])
            ->sorts(['name', 'created_at']);
    }
}
# That's it! Your API is ready:
GET /query/users?filter[name][like]=John&sort=-created_at

Ecosystem

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

📄 License

MIT

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-25