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 Html

Laravel Datatables Html Laravel Package

yajra/laravel-datatables-html

Laravel DataTables HTML plugin for Laravel: build DataTables markup and initialization scripts in PHP, with Laravel 12+ support and Vite-friendly module output. Works with yajra/laravel-datatables to streamline table configuration and rendering.

View on GitHub
Deep Wiki
Context7

Laravel DataTables HTML builder plugin

Frequently asked questions about Laravel Datatables Html
How do I install yajra/laravel-datatables-html for Laravel 12+?
Run `composer require yajra/laravel-datatables-html:^13` and add `Builder::useVite()` in your `AppServiceProvider` to enable ViteJS module support. Ensure `yajra/laravel-datatables` is also installed as a dependency.
Can this package handle large datasets (e.g., 50,000+ rows) efficiently?
Yes, it leverages server-side processing via `yajra/laravel-datatables`, which offloads pagination, sorting, and filtering to your database. Monitor query performance and optimize with indexing or caching if needed.
Does yajra/laravel-datatables-html work with Livewire 4?
Yes, it supports Livewire 4+ via the `->useLivewire()` method. This enables reactive tables where client-side interactions (e.g., search) trigger server-side updates without full page reloads.
How do I customize the DataTables HTML output (e.g., add buttons, change styling)?
Use the builder methods like `->buttons()`, `->style()`, or `->className()` to modify appearance. For advanced customization, publish assets with `php artisan vendor:publish --tag=datatables-html` and extend via macros or JavaScript templates.
Is this package compatible with Laravel 13, or should I wait for updates?
The package supports Laravel 13 via the `^13` version tag. Check the [GitHub releases](https://github.com/yajra/laravel-datatables-html/releases) for breaking changes, but it’s generally stable for Laravel 11–13.
Can I use this with Inertia.js or Alpine.js for SPAs?
Yes, pass the DataTables configuration as props to Inertia.js components or use Alpine.js for lightweight client-side interactions. The package generates clean HTML/JS that integrates seamlessly with modern frontend stacks.
How do I implement row-level permissions (e.g., hide columns for non-admin users)?
Use `->visibleIf()` with Laravel’s auth helpers, Gates, or Policies. Example: `->column('secret_data')->visibleIf(fn() => auth()->user()->isAdmin)`. Combine with Laravel’s authorization system for granular control.
What’s the difference between this package and client-side DataTables implementations?
This package generates **server-side processed** tables via PHP, avoiding client-side bottlenecks for large datasets. Client-side implementations (e.g., jQuery DataTables with static JSON) load all data into memory, while this package streams results from the database.
Does it support exporting data to CSV/Excel?
Yes, use `->exportButtons()` to add export controls. For server-side exports, configure custom routes or leverage the `->buttons()` method with `Button::export()` for CSV/Excel downloads.
Are there alternatives if I need real-time updates (e.g., WebSocket-based)?
For real-time tables, pair this package with **Laravel Echo/Pusher** or **Livewire’s reactivity**. Use `->useLivewire()` for search-as-you-type or `->ajax()` with custom event listeners for WebSocket-driven updates.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai