yajra/laravel-datatables-export
Laravel DataTables export plugin for server-side exporting via queued jobs, OpenSpout, and Livewire. Adds an export button component and DataTable trait (WithExportQueue) to generate Excel/CSV exports for jQuery DataTables 2.x on Laravel 13.
DataTable classes via the WithExportQueue trait, requiring minimal changes to existing data table implementations.yajra/laravel-datatables (v13.x), yajra/laravel-datatables-buttons (v13.x).php artisan queue:work). Downtime during export jobs could impact user experience.queue:batches-table, which may need tuning for large datasets (e.g., chunking, memory limits).datatables-export.php). Large exports may fill disk space if not purged (scheduled via datatables:purge-export).tmp_path configuration (see v11.4.3).<livewire:export-button> component. If Livewire isn’t used, a custom Blade component would need to replicate the export logic (e.g., via AJAX to a controller).composer require yajra/laravel-datatables-export:"^13.0" yajra/laravel-datatables-buttons:"^13.0" laravel-livewire/livewire
php artisan queue:batches-table
php artisan migrate
php artisan queue:work
DataTable classes to use WithExportQueue:
use Yajra\DataTables\WithExportQueue;
class UserDataTable extends DataTable
{
use WithExportQueue;
// ...
}
<livewire:export-button :table-id="$dataTable->getTableId()" filename="users.xlsx" />
php artisan vendor:publish --tag=datatables-export
storage/app/exports), purge schedules, and date formats in config/datatables-export.php.sheetName(), exportFormat(), or filename() as needed.ExportButton Livewire component for custom UI logic.yajra/laravel-datatables-buttons directly.yajra/laravel-datatables-export, OpenSpout, and PHPSpreadsheet (v5+).datatables-export.php may need adjustments for:
laravel.log for queue job failures.php artisan queue:failed-table to inspect stuck exports.php artisan datatables:export).queue:work --once).queue:work processes (e.g., 4–8 workers for high load).failed_jobs, jobs) is optimized for writes.How can I help you explore Laravel packages today?