पेज · Laravilt
ExportAction
Export records to XLSX or CSV with Laravel Excel.
ExportAction uses Laravel Excel (maatwebsite/excel).
php
Defaults: name export, label "Export", icon download, color gray, XLSX format.
Generate an exporter
bash
This creates app/Exports/ProductExporter.php, a Laravel Excel export class (FromQuery, WithHeadings, WithMapping). Edit query(), headings(), and map() to shape the file.
Format
php
Without an exporter class
Without an exporter, the action exports the collection or query it receives, using the headings you give it:
php
Queued exports
php
API reference
| Method | Description |
|---|---|
exporter(string) | Laravel Excel export class |
fileName(string) | Output file name |
xlsx(), csv(), writerType(string) | Output format |
headings(array), columns(array) | Columns for class-less exports |
modifyQueryUsing(Closure) | Adjust the query before exporting |
queue(), disk(), filePath() | Queued exports |