spatie/laravel-query-builder
Build safe, flexible Eloquent queries from incoming API requests. Supports whitelisted filtering (partial/exact/scope/custom), sorting, includes, field selection, pagination, and grouped AND/OR filters—ideal for JSON:API-style endpoints with minimal boilerplate.
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?