spiral/data-grid
Spiral Data Grid is a PHP package for building flexible, framework-agnostic data grids with sortable columns, filtering, pagination, and customizable rendering. It turns arrays or ORM results into interactive tables quickly while keeping configuration clean and extensible.
spiral/data-grid makes "which fields can a customer filter and sort by?" an explicit, versioned artifact (a specification class) rather than an emergent property of whatever the controller happens to read from the query string. That is a product decision, not just a technical one — it defines what slicing capability we sell/enable.$request->query() parsing repeated per endpoint, or a full admin-panel generator. This package sits in the middle: a small, MIT-licensed specification builder you wire to your own query layer.Adopt when:
Look elsewhere when:
spatie/laravel-query-builder are faster to ship and far more idiomatic for a Laravel team.Practical gate before committing: a one-sprint spike on two real endpoints, measuring (a) lines of code removed, (b) generated SQL sanity, (c) whether the Laravel bridge covers your query patterns, and (d) whether a junior engineer can add a new filter without reading the source.
For executives (30 seconds): This is a small, free (MIT) PHP library that turns filtering, sorting, and pagination into a defined, reviewable product contract instead of ad-hoc code scattered across endpoints. The business value is speed and safety: every new "let customers filter their data" request becomes a ~20-line spec change rather than a custom build, and the set of things customers are allowed to filter by becomes explicit and auditable. Cost is negligible; the risk is that it's a niche library with a small community, so I recommend a bounded two-week pilot on 2–3 endpoints behind our own internal interface, which we can swap out for a hand-rolled version in about a day if it disappoints.
For engineering leads: The core package is ORM-agnostic — you define immutable grid specifications, one mapper parses the request into a spec, and readers translate specs into your data source. That separation is genuinely useful: it gives us thin controllers, testable filter logic, and a single place to enforce allow-lists. The trade-offs are an extra abstraction layer, a bridge package we'll need to validate against our query-builder patterns, and thin documentation. Mitigation: wrap it behind our own GridService contract so the library is an implementation detail, not a dependency smeared across controllers. If the spike shows friction, we drop it and keep the interface.
Positioning vs. alternatives: not a replacement for Filament/Nova (UI) or Scout/Meilisearch (search relevance) — it's the layer between "HTTP request" and "database query." Frame it as infrastructure, and let the pilot, not the pitch, make the call.
How can I help you explore Laravel packages today?