yajra/laravel-datatables-buttons
Laravel DataTables Buttons plugin for server-side exports and printing. Adds CSV, Excel, PDF, and print support to yajra/laravel-datatables with DataTables Buttons integration. Works with Laravel 12+ and PHP 8.3+.
13.x for Laravel 13).php-phantomjs for PDF generation).9.x for Laravel 9) or custom fork.| Risk Area | Mitigation Strategy |
|---|---|
| PHP 8.3+ Requirement | Phase upgrade in non-production environments first; test with Laravel Pint. |
| Asset Bloat | Use tree-shaking (e.g., Webpack/Vite) to load only required DataTables buttons. |
| PDF Generation | Test PhantomJS/WKHTMLtoPDF compatibility; fallback to custom routes if needed. |
| Macro/Stubs Complexity | Start with basic exports, then layer custom macros for advanced use cases. |
| OpenSpout Dependencies | Verify PHP extensions (dom, fileinfo) are enabled in production. |
OpenSpout vs. legacy FastExcel to validate gains.drawCallback for dynamic UI updates.Laravel Octane flag).composer require yajra/laravel-datatables-buttons:^13.php artisan vendor:publish --tag=datatables-buttons.routes/web.php (e.g., Route::post('export', [DataTables::class, 'export'])).DataTable::macro('withTaxSummary', fn($query) => ...)).DataTables::setScopes()).| Component | Compatibility Notes |
|---|---|
| Laravel 12/13 | Full support; use ^13.x for Laravel 13. |
| Laravel 11 | Use v11.x (last compatible version). |
| Laravel <11 | Downgrade to v9.x or fork; no official support. |
| jQuery DataTables | Requires v1.10.x; test with latest stable (e.g., 1.13.6). |
| Frontend Frameworks | React/Vue: Use Alpine.js or Laravel Mix to avoid jQuery conflicts. |
| PDF Libraries | PhantomJS/WKHTMLtoPDF: Verify Docker/host compatibility. |
| PHP Extensions | OpenSpout: Needs dom, fileinfo; PDF: Needs ghostscript or equivalent. |
MAJOR.MINOR.PATCH; Laravel version-locked (e.g., 13.x for Laravel 13).13.2.0 for enum support).v13.1.0).1.10.28) to avoid UI regressions.config/datatables.php for global settings (e.g., default export formats).How can I help you explore Laravel packages today?