realzone22 / laravel-query-gate
Generic HTTP gateway for Laravel Eloquent queries.
Package info
git.cyanfox.de/RealZone22/laravel-query-gate
pkg:composer/realzone22/laravel-query-gate
1.0.0
2026-01-25 11:37 UTC
Requires
- php: ^8.2
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/pagination: ^10.0|^11.0|^12.0
- illuminate/pipeline: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.5|^11.0
README
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?
| Feature | Query Gate | Laravel 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