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.
Architecture fit
spiral/data-grid is a specification builder, not a UI grid and not a query builder. It gives you an immutable object graph — filters, sorters, paginators — plus a Driver contract that translates that specification onto a data source. The core is framework-agnostic and does not depend on Laravel, Spiral's container, or any HTTP layer, which is the main reason it is even worth evaluating for a Laravel stack.request()->get('sort') logic across controllers and repositories.php artisan scaffolding). There is no Laravel-first equivalent of what spiral/filters or Spiral's grid bridge provides.spatie/laravel-query-builder or EloquentFilter for the same job. spiral/data-grid offers a stricter, more typed, more serialisable spec model, but at the cost of writing and owning the Eloquent glue yourself.Integration feasibility
Illuminate\Database\Eloquent\Builder / the Query Builder, and adapt Laravel's Request into the grid's input object (the reference implementations assume PSR-7 request input).like, gt, in, between), sort whitelisting, pagination (offset/limit plus a separate count), and error handling for unknown field names. This is bounded, reviewable work — not a research project — but it is permanent in-house code.illuminate/* if any driver pulls it in), whether specifications are serialisable (useful for caching/hashing filter state), and how the package signals invalid input vs. throwing.Technical risk
Key questions
spatie/laravel-query-builder), and what does this package buy us that it does not?Stack fit
Migration path
GridQuery::for(Model::class, $spec)) so the package never leaks into controllers or domain code.app/Grid/ or an internal composer package) with its own tests, so it survives as an asset independent of the upstream dependency.Compatibility
"spiral/data-grid": "x.y.*") rather than using a caret constraint; with low release volume you gain little from float and lose reproducibility.psr/* constraints against the rest of the lockfile.Sequencing
like filters, one sort, offset pagination. Decide go/no-go on the ergonomics.spatie/laravel-query-builder, and an exit plan.Maintenance
Support
Scaling
COUNT(*) on large filtered sets, avoiding N+1 when filters touch relations, and stable keyset pagination if you exceed offset limits.Failure modes
"0" vs. boolean, date formats) → silently wrong result sets, which are harder to detect than errors.Ramp-up
How can I help you explore Laravel packages today?