yajra/laravel-datatables-export
Laravel DataTables Export is a plugin for yajra/laravel-datatables that enables server-side exports via queues and OpenSpout, with optional Livewire and DataTables button integrations. Requires PHP 8.3+ and Laravel 13. Install via Composer, run queue:batches-table and migrate, then publish assets fo...
max_execution_time or memory limits. That's a decision with operational consequences (queue workers, batch table, storage), and it should be made explicitly rather than discovered in production.ExportStarted / ExportCompleted / ExportFailed events plus an emailTo option support "export and email me when it's ready" — a genuine UX differentiator for long-running reports, and a cheap way to satisfy enterprise buyers who expect it.exportFormat controls (leading-zero preservation for phone numbers, numeric formats, date formats) are product decisions about data fidelity. Deciding them at the DataTable definition level keeps exports consistent across every screen.token_ttl, default 1,440 minutes) force us to answer "how long do exported files live and who can fetch them?" — a question legal/security will ask anyway.dataTables.queuedExport.js button) doesn't block the backend work. We can ship one and add the other later.Consider it when:
laravel-datatables-buttons + jQuery DataTables 2.x). The value is proportional to existing investment; on a non-Yajra stack the integration savings evaporate.job_batches table. Without this, the package's core promise (non-blocking, reliable) is unmet.Look elsewhere when:
For executives (one paragraph): Users keep asking for "export this table to Excel." Today that request means engineering builds the same thing repeatedly — and the naive version breaks on large tables, timing out requests and tying up server capacity. This open-source MIT-licensed plugin removes that work: it is a small add-on to a library we already use, and it moves exports off the request cycle onto background workers, so big exports complete reliably instead of failing. Adopting it converts a repeating feature request into a configuration change, and it comes with the operational guardrails — progress feedback, expiring download links, automatic file cleanup — that we would otherwise have to design and maintain ourselves.
For engineering (one paragraph): yajra/laravel-datatables-export adds a WithExportQueue trait to DataTable service classes, wiring DataTables export buttons (or a Livewire export-button component) to a queued job that generates xlsx/csv via OpenSpout. It ships encrypted status/download URLs with a configurable TTL, batch-based progress polling, row-level progress reporting, JS callbacks and DOM events (datatables-export:start|progress|success|error), server-side ExportStarted/ExportCompleted/ExportFailed events, per-column exportFormat for numeric/date/text fidelity, a configurable queue, and a datatables:purge-export command for scheduled cleanup. Integration is a trait, a button definition, and a published config/asset tag — no custom job or controller required. Constraints to note: Laravel 13 and PHP 8.3+ only (OpenSpout 5 pushes to PHP 8.4), it requires the job_batches migration, it needs a running queue worker, and it depends on laravel-datatables-buttons ^13.0. Also flag that the project is young and thinly adopted — we should pin versions, plan a smoke test around queue config and token expiry, and treat the export job as code we may eventually need to own.
How can I help you explore Laravel packages today?