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.
yajra/laravel-datatables (server-side processing) and modern Laravel features like Livewire, making it ideal for admin panels, SaaS platforms, or internal tools where tabular data is central.->visibleIf()).Builder::useVite()), ensuring compatibility with modern asset compilation and tree-shaking.yajra/laravel-datatables (server-side processing) and Laravel 12+.laravellux/html (replaces deprecated laravelcollective/html) for form/HTML helpers.{{ DataTables::table()->render() }}.DataTables::of(Model::query()) for server-side processing.Builder::useLivewire() for real-time updates.Builder::useVite().| Risk Area | Risk Level | Mitigation |
|---|---|---|
| Laravel Version Lock | Medium | Package is versioned per Laravel release (12.x → v13.x). Upgrade path is clear. |
| Vite Dependency | Low | Fallback to CDN or manual asset inclusion if Vite is not used. |
| Livewire Compatibility | Medium | Test with Livewire 4+; may require adjustments for custom event handling. |
| Asset Publishing | Low | Optional vendor:publish step; defaults to CDN if not published. |
| Performance Overhead | Low | Server-side processing reduces client-side load; Vite optimizes assets. |
| Customization Limits | Medium | Advanced JS features may require manual overrides (e.g., custom plugins). |
| Deprecation Risk | Low | MIT-licensed with active maintenance (releases every 3–6 months). |
rowReorder, fixedColumns) beyond what this package supports?v11.x or v10.x.DataTables::of(User::query())).Route::get('/users', [DataTablesController::class, 'index'])).{{ DataTables::table()->render() }}.Builder::useVite()).Builder::useLivewire()).->addColumn() for computed fields.| Phase | Action Items | Dependencies |
|---|---|---|
| Preparation | 1. Audit existing tables for server-side vs. client-side needs. | - |
| 2. Upgrade Laravel to 12/13 if not already. | Laravel 12+ | |
3. Install yajra/laravel-datatables-html and yajra/laravel-datatables. |
Composer | |
| Core Integration | 4. Configure AppServiceProvider with Builder::useVite() and Paginator::useBootstrapFive(). |
Vite, Bootstrap |
5. Publish assets (optional): php artisan vendor:publish --tag=datatables-html. |
- | |
| Table Implementation | 6. Replace JS DataTables with PHP fluent API in Blade templates. | Eloquent models |
7. Create API routes for server-side processing (e.g., DataTablesController). |
API routes | |
| Enhancements | 8. Add Livewire integration for real-time features. | Livewire 4+ |
9. Customize columns/buttons using fluent methods (e.g., ->addColumn()->addButton()). |
- | |
| Testing | 10. Test pagination, sorting, and filtering with large datasets. | Database load tests |
| 11. Validate Vite asset compilation and Livewire event handling. | Vite, Livewire |
Phase 1: Core Tables (2–3 weeks)
Phase 2: Enhancements (1–2 weeks)
Phase 3: Optimization (Ongoing)
Phase 4: Edge Cases (1 week)
How can I help you explore Laravel packages today?