behindsolution/laravel-query-gate

Generic HTTP gateway for Laravel Eloquent queries.

Installs: 60

Dependents: 0

Suggesters: 0

Security: 0

Stars: 46

Watchers: 4

Forks: 3

Open Issues: 0

pkg:composer/behindsolution/laravel-query-gate

v1.6.3 2026-01-20 21:35 UTC

README

Latest Version Tests Total Downloads License

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

Why Query Gate?

Feature Query Gate Laravel Orion
API Versioning ✅ Built-in
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