Weave Code
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
Laravel Datatables

Laravel Datatables Laravel Package

yajra/laravel-datatables

Complete Laravel DataTables installer (core + plugins) for DataTables 2.x, including Editor, Buttons, and Select support. Works with Laravel 13 and PHP 8.3+, providing server-side processing integration and tooling for fast, rich table UIs.

View on GitHub
Deep Wiki
Context7

yajra/laravel-datatables is a complete installer for Laravel DataTables, bundling the core server-side integration plus commonly used DataTables plugins to quickly build searchable, sortable, paginated tables in Laravel.

Designed for modern stacks (PHP 8.3+, Laravel 13.x, DataTables 2.x), it streamlines setup and provides a cohesive package for DataTables + Editor workflows.

  • Complete installer for core + plugins in one package
  • Seamless server-side processing for large datasets
  • Integrates with DataTables 2.x and Editor 2.x
  • Supports Buttons and Select extensions
  • Clear Laravel version compatibility across major releases
Frequently asked questions about Laravel Datatables
How do I install yajra/laravel-datatables in a Laravel 13.x project?
Run `composer require yajra/laravel-datatables:^13` to install the package. Then register the service provider in `config/app.php` under `providers` (optional for Laravel 5.5+). Publish assets with `php artisan vendor:publish --tag=datatables` if needed.
Does this package support DataTables 2.x extensions like Editor and Buttons?
Yes, the package bundles core DataTables 2.x plus Editor, Buttons, and Select extensions. These are pre-configured for server-side processing in Laravel, so you can enable exports, inline editing, and row selection with minimal setup.
Will this work with Livewire or Inertia.js in Laravel 13?
Absolutely. The package returns JSON responses for server-side processing, which works seamlessly with Livewire (via `wire:table` or custom API calls) or Inertia.js (by consuming the JSON endpoints in your frontend).
What Laravel versions does yajra/laravel-datatables support?
The package follows Laravel’s major versioning: `^13` for Laravel 13.x, `^12` for Laravel 12.x, etc. Always check the [compatibility table](https://github.com/yajra/laravel-datatables#laravel-version-compatibility) to align versions correctly.
How do I optimize queries for large datasets (e.g., 50k+ rows)?
Use column selection (`columns` array) to fetch only needed fields, leverage Eloquent relationships with `with()`, and avoid `SELECT *`. The package supports custom SQL and joins, so you can fine-tune queries to minimize database load.
Can I use this with a headless frontend (React/Vue) instead of Blade?
Yes, the package outputs JSON via API endpoints, making it ideal for headless setups. Just fetch the data in your frontend framework (e.g., `axios.get('/api/data')`) and render it with DataTables 2.x client-side.
Are there alternatives to yajra/laravel-datatables for Laravel?
Yes, alternatives include `spatie/laravel-data-grid` (for simpler grids) or `maatwebsite/excel` (for exports). However, yajra/laravel-datatables is the most feature-rich for DataTables 2.x integration, especially with Editor/Buttons/Select.
How do I debug server-side JSON responses from DataTables?
Use Laravel’s `dd()` or `Log::debug()` to inspect the JSON payload. Tools like Laravel Debugbar or browser dev tools (Network tab) can also help visualize the response structure. Enable `debug: true` in the DataTables config for verbose errors.
Does this package work with PHP 8.3’s new features like named arguments?
Yes, the package is optimized for PHP 8.3+ and leverages modern features like named arguments, attributes, and performance improvements. It’s built to work seamlessly with Laravel 13.x’s updated stack.
How do I add custom sorting or filtering logic to DataTables?
Override the `getCustomOrder()` or `getCustomFilter()` methods in your DataTables controller. For complex logic, use raw SQL or Eloquent scopes. The package’s server-side processing allows full control over query behavior.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport