spatie/laravel-query-builder
Easily build Eloquent queries from API requests observed · 2026-08-28
Health v2 · maintenance only
97/100
- Activity 96
- Release rhythm 96
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 12.5
- age_days: 3152
- days_rel: 26
- days_push: 26
- n_releases_24m: 25
Adoption not part of the score
4465 stars · 420 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A Laravel package that builds Eloquent queries from API request parameters, supporting filtering, sorting, field selection, and relationship includes following JSON API conventions. It extends Laravel's default Eloquent builder so existing query methods and macros remain available.
Use cases
- filter api results by query parameters
- sort collections from a request in laravel
- allow clients to include relationships in api responses
- build json api compliant query parameters
- securely whitelist filters and sorts on eloquent queries
- add search and pagination filters to a rest api
When to choose
- you build Laravel APIs and want request-driven filtering, sorting, and includes
- you want JSON API-style query parameters with whitelisting for safety
- you want to compose on top of existing Eloquent queries and scopes
When to avoid
- your project is not Laravel/PHP
- you need complex custom query logic better expressed in dedicated repository classes
- you use a non-Eloquent data source
Facets
library · maturity stable
orm api-framework routing web-development backend apis databases php laravel eloquent json-api query-filtering spatie web-server
10 sources
- readme: https://github.com/spatie/laravel-query-builder · fetched 2026-08-28 · 9ca124136c68
- homepage: https://spatie.be/docs/laravel-query-builder · fetched 2026-08-29 · fcf3c1f16d50
- site_page: https://spatie.be/docs · fetched 2026-08-29 · 08e024d86d95
- site_page: https://spatie.be/about-us · fetched 2026-08-29 · d3cb88e4b34c
- site_page: https://spatie.be/docs/laravel-query-builder/v7 · fetched 2026-08-29 · 5d2366c7210b
- site_page: https://spatie.be/docs/laravel-query-builder/v6 · fetched 2026-08-29 · 6b1e85e23512
- site_page: https://spatie.be/docs/laravel-query-builder/v5 · fetched 2026-08-29 · a754641de91c
- site_page: https://spatie.be/docs/laravel-query-builder/v4 · fetched 2026-08-29 · 3710b586c349
- site_page: https://spatie.be/docs/laravel-query-builder/v3 · fetched 2026-08-29 · b6dc0ef0af60
- site_page: https://spatie.be/docs/laravel-query-builder/v2 · fetched 2026-08-29 · 303c29cda3c8
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| spatie/laravel-query-builder | main | 97 |
For agents
markdown · JSON · MCP: product_card(name="spatie/laravel-query-builder")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem