spatie/laravel-query-builder
Safely build Eloquent queries from incoming API requests. Allowlist filters, sorts, includes, and fields; supports partial/exact and custom filters, nested relationships, relation counts, and default values. Works with existing queries for clean, consistent endpoints.
The Query Builder package requires PHP 8.3 or above and Laravel 12 or above.
We only support and maintain the latest version. If you do not meet the minimum requirements, you can opt to use an older version of the package.
How can I help you explore Laravel packages today?