joy/voyager-datatable
joy/voyager-datatable brings server-side DataTables to Laravel Voyager admin panels. Turn BREAD models into sortable, searchable, paginated AJAX tables, replacing default Voyager listings with faster, more flexible data grids for back-end management. Includes configurable columns and AJAX endpoints.
the-control-group/voyager) and typically yajra/laravel-datatables-oracle. Add the package:
composer require joy/voyager-datatable
config/ and src/ to see what it actually registers: it is a thin bridge between Voyager's BREAD system and yajra/laravel-datatables. There is no meaningful public docs site, so treat the GitHub README and source as the spec.<table>) with an AJAX DataTable, so large tables paginate, search, and sort server-side instead of loading all rows.php artisan vendor:publish --tag=...), inspect it.Yajra\DataTables\Services\DataTable or the package's base class).EloquentDataTable subclass with query(), html(), and ajax() methods. Keep the query in query() and column definitions in html() so the same class is reusable from an admin controller and any custom endpoint.with() relationships you render as columns:
public function query(Model $model)
{
return $model->newQuery()->with(['author:id,name', 'category:id,title']);
}
addColumn/editColumn, not raw SQL aliases, for computed or relation output. Keeps your select() stable and lets rawColumns() stay explicit.filterColumn / filter() for BREAD-specific search fields. This is where you recreate whatever custom filters Voyager's default list had.ajax() URL to it. Don't rely on the package silently hooking Voyager's controller — verify in php artisan route:list --path=admin.index() (via a custom controller in config/voyager.php) and return the DataTable's render() from your view.$dataTable->table(). Extend it in resources/views/vendor/... rather than editing vendor files, and push the scripts() in a @push('javascript') stack so Voyager's layout picks it up.yajra/laravel-datatables-buttons, add the ButtonServiceProvider action in the builder and expose export columns in a Voyager "actions" dropdown.csrf, ->parameters(), column search behavior). Pin versions.filterColumn() or a whereHas() clause; otherwise global search returns wrong results.rawColumns risk. Any HTML in a column (links, badges) must be listed in rawColumns(). Forgetting it renders escaped markup — a common "why is my action button text?" bug. Conversely, never put user-controlled data in a raw column without e()/escaping.$dataTable->ajax() includes csrf and the view has <meta name="csrf-token"> in Voyager's layout.admin middleware group and prefix from config/voyager.php. Changing routes.prefix or using a custom admin domain will break hardcoded URLs — grep the source for admin/ before assuming flexibility.storage/logs/laravel.log and enable query logging around query().resources/views/vendor/, config overrides, and your own DataTable subclasses are the reliable customization surface. Avoid editing vendor files.ORDER BY and LIKE '%term%' on the fly. For high-traffic admin panels, prefer searchable => false on expensive fields and use explicit filters.query() so you're not locked in.How can I help you explore Laravel packages today?