Skip to content
You're reading the docs for Laravel Excel 3.0. The current version is Laravel Excel 4.x (upgrade guide).

Export concerns ​

InterfaceExplanation
Maatwebsite\Excel\Concerns\FromCollectionUse a Laravel Collection to populate the export.
Maatwebsite\Excel\Concerns\FromQueryUse an Eloquent query to populate the export.
Maatwebsite\Excel\Concerns\FromViewUse a (Blade) view to populate the export.
Maatwebsite\Excel\Concerns\WithTitleSet the Workbook or Worksheet title.
Maatwebsite\Excel\Concerns\WithHeadingsPrepend a heading row.
Maatwebsite\Excel\Concerns\WithMappingFormat the row before it's written to the file.
Maatwebsite\Excel\Concerns\WithColumnFormattingFormat certain columns.
Maatwebsite\Excel\Concerns\WithMultipleSheetsEnable multi-sheet support. Each sheet can have its own concerns (except this one).
Maatwebsite\Excel\Concerns\ShouldAutoSizeAuto-size the columns in the worksheet.
Maatwebsite\Excel\Concerns\WithStrictNullComparisonUses strict comparisions when testing cells for null value.
Maatwebsite\Excel\Concerns\WithEventsRegister events to hook into the PhpSpreadsheet process.
Maatwebsite\Excel\Concerns\WithCustomQuerySizeAllows Exportables that implement the FromQuery concern, to provide their own custom query size.
Maatwebsite\Excel\Concerns\WithCustomCsvSettingsAllows to run custom Csv settings for this specific exportable.
Maatwebsite\Excel\Concerns\WithChartsAllows to run one or multiple PhpSpreadsheet Chart instances.
Maatwebsite\Excel\Concerns\WithDrawingsAllows to run one or multiple PhpSpreadsheet (Base)Drawing instances.
Maatwebsite\Excel\Concerns\WithCustomStartCellAllows to specify a custom start cell. Do note that this is only supported for FromCollection exports.

Traits ​

TraitExplanation
Maatwebsite\Excel\Concerns\ExportableAdd download/store abilities right on the export class itself.
Maatwebsite\Excel\Concerns\RegistersEventListenersAuto-register the available event listeners.