uam/datatables-bundle
uam/datatables-bundle integrates jQuery DataTables into Symfony apps, adding server-side processing, Doctrine query support, and configurable column handling so you can build sortable, searchable, paginated tables with minimal boilerplate.
Read this first: the package does not run on Laravel. uam/datatables-bundle is a Symfony 2 bundle (Symfony\Bundle\FrameworkBundle dependency, AppKernel registration, Assetic/Twig wiring). Its score, 4 stars and 0 dependents reflect that it is effectively unmaintained, and Symfony 2 reached end-of-life in November 2018. You cannot composer require it into a Laravel 9/10/11 app without dependency conflicts on symfony/framework-bundle and twig/twig.
So there are two realistic entry points:
composer require uam/datatables-bundle, register new UAM\DatatablesBundle\UAMDatatablesBundle() in app/AppKernel.php, then php app/console assets:install --symlink so the bundled jQuery DataTables assets land in web/bundles/. Look first at Resources/views/ for the Twig table template and at the base DataTable class in the bundle root — that abstract class is the contract you extend.yajra/laravel-datatables for the actual work, and read this repo's DataTable abstraction only as a design reference for structuring column definitions and server-side response payloads. The DataTables jQuery plugin itself (the thing this bundle wraps) is framework-agnostic and will work fine behind a Laravel route returning JSON.First use case, either way: render a table shell in a Blade/Twig view, point DataTables at a JSON endpoint, and have that endpoint translate draw/start/length/order/search query params into a paginated, ordered, filtered query.
Subclass-per-table. The bundle's model is one class per table: extend the provided base class, declare columns and the data source (query builder or array), and let the bundle serialise the response. Mirror this in Laravel with a dedicated DataTable class per resource rather than stuffing logic into the controller — it keeps column definitions, searchable flags, and ordering whitelists in one auditable place.
Controller as a thin JSON endpoint. The controller should only resolve the DataTable service and return its response. Any business filtering (tenant scoping, soft-delete exclusion) belongs in the query builder passed to the DataTable, not in where clauses appended to the request after the fact.
Server-side vs client-side. Use client-side mode only for small, static datasets under a few thousand rows. For anything else, use server-side processing: it is the whole reason to have a backend bundle. Client-side mode on a large table will appear to work in dev and then destroy the browser in production.
Integration with an existing repository. Feed the DataTable a Doctrine QueryBuilder (Symfony) or Eloquent builder (Laravel port) and let the adapter apply orderBy/offset/limit. This composes cleanly with existing scopes and policies because you never bypass the ORM.
Response shape. Keep the DataTables contract exact: draw, recordsTotal, recordsFiltered, data. recordsTotal must be the unfiltered count and recordsFiltered the post-search count — swapping them is the single most common cause of "Showing 1 to 10 of 10 entries" while pagination clearly has more pages.
Auth before serialisation. Put the authorization check in the controller or a middleware/event listener, before the DataTable executes. Server-side processing is a full data-exfiltration surface if the endpoint is reachable without the same policy checks as the HTML page.
draw counter must be echoed back verbatim. If you return a hardcoded value, DataTables will silently drop out-of-order responses and the table will flicker or stall under concurrent requests.ORDER BY. Both this bundle's era and hand-rolled ports are vulnerable here. Map the incoming order[0][column] index to a fixed whitelist of column names you defined in the DataTable class; never interpolate the raw parameter.VerifyCsrfToken will reject the DataTables GET/POST unless you send the token header or exempt the route deliberately. Exempting blindly reintroduces the auth problem above.Resources/public is pinned to whatever was current when the bundle was last touched. If your layout also loads DataTables from a CDN at a different major version, expect plugin API mismatches (fnServerData vs ajax, legacy Hungarian notation). Pick one source.assets:install was run without --symlink on a case-insensitive filesystem, and the Twig template then renders an empty table with no console error beyond a 404 on the JS.recordsTotal runs a COUNT(*) on every keystroke-triggered request. Cache the unfiltered total per table (and invalidate on write) if the table is large; the filtered count must stay live.app/Resources/UAMDatatablesBundle/views/, and replace the base class via a service definition override in services.yml. Both are unsupported-by-documentation but stable in practice.yajra/laravel-datatables or even a hand-written controller.How can I help you explore Laravel packages today?