Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laratables Laravel Package

freshbitsweb/laratables

freshbitsweb/laratables simplifies Laravel DataTables server-side processing with Eloquent support, relationship search, eager loading, sorting, and pagination, helping you build fast, interactive data tables with minimal code and less boilerplate.

View on GitHub
Deep Wiki
Context7

Ajax support of DataTables (Laravel 5.5 to Laravel 11.x)

Frequently asked questions about Laratables
What is freshbitsweb/laratables and what does it do?
Laratables is a Laravel package that adds Ajax support to jQuery DataTables by handling server-side processing. You generate a Laratables class with an artisan command, define the Eloquent query and column mapping, and expose a JSON endpoint returning the draw, recordsTotal, recordsFiltered, and data payload DataTables expects. Sorting, searching, pagination, and relation search stay on the server, so your Blade tables remain fast with minimal boilerplate.
How do I install and configure Laratables in Laravel?
Install with composer require freshbitsweb/laratables, publish the config file, and run php artisan make:laratables User to scaffold a table class. In that class you define records() for the base query plus the column mapping used for search and sort. Then register a route pointing at the class and set the DataTables ajax option to that URL, loading the DataTables JS from a CDN or your npm build.
Which Laravel and PHP versions does Laratables support?
The package advertises support for Laravel 5.5 through Laravel 11.x, which covers both legacy and current applications. PHP constraints are declared in its composer.json, so verify that file against your runtime rather than assuming. Each new Laravel major usually needs a package release before you can upgrade, so confirm compatibility before bumping your framework.
How does Laratables handle relationship columns, search, and eager loading?
Laratables lets you map relation columns such as user.name and will eager load them, which avoids the N+1 queries you would otherwise write by hand. Search and sort can target those relation columns through the column mapping. Keep an eye on your query log, because deep joins and LIKE '%term%' searches still cost what they cost and the package does not optimize them for you.
Can I use Laratables with Inertia, Vue, React, or Livewire?
Laratables is built for jQuery DataTables server-side processing, so it fits Blade admin panels best. In Inertia, Vue, React, or Livewire apps you would either run jQuery DataTables as the table engine under the hood or bypass the package's DataTables-shaped endpoint entirely. It is not a general-purpose REST list API, so treat it as a Blade-era tool when choosing your frontend stack.
How do I authorize and scope Laratables queries per user or tenant?
The routes you expose for Laratables are ordinary Laravel routes, so protect them with your usual auth and policy middleware. The package does not scope queries for you: add where clauses for the current user or tenant inside the records() query of each Laratables class, or centralize the constraint with a global scope. A missing constraint is a data exposure bug, not a framework failure.
How does Laratables compare to yajra/laravel-datatables?
Yajra Laravel DataTables is the larger, older ecosystem with broader features such as export and editor integrations, while Laratables is a smaller, thinner adapter focused on Eloquent server-side processing. Laratables is quick to adopt for simple Blade tables, whereas Yajra has more community support and extensions. Avoid running both in one codebase unless you have a clear reason.
Why is my Laratables endpoint slow on large tables?
The DataTables protocol requires a total and filtered count per request, so COUNT(*) over large or heavily joined tables is the usual bottleneck, and that is inherent to the protocol rather than a package defect. Mitigate with indexed sort columns, narrower base queries, avoiding leading-wildcard searches on huge columns, and caching counts where possible. Profile the generated SQL before blaming the package.
Can Laratables handle CSV export, bulk actions, or custom raw columns safely?
Laratables is read-path only: it returns list data and has no built-in export, bulk action, or write surface, so CSV or Excel export and batch operations are application code. Raw columns and addColumn closures run whatever SQL or output you supply, and escaping is your responsibility, so never interpolate request input into raw fragments. Use parameter bindings and escape output in your Blade views.
Is Laratables actively maintained and how should I test it?
Laratables is a small single-maintainer package with active releases but no commercial support tier or SLA, so plan for the bus factor. Test it with feature tests that hit your JSON endpoint and assert the draw, recordsTotal, recordsFiltered, and data keys, plus your authorization scoping. If maintenance stalls, the fallback is forking the package or replacing it with a hand-written query builder endpoint that returns the same payload.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections