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

Export concerns ​

InterfaceExplanationDocumentation
Maatwebsite\Excel\Concerns\FromArrayUse an array to populate the export.Exporting collections
Maatwebsite\Excel\Concerns\FromCollectionUse a Laravel Collection to populate the export.Exporting collections
Maatwebsite\Excel\Concerns\FromGeneratorUse a generator to populate the export.From Generator
Maatwebsite\Excel\Concerns\FromIteratorUse an iterator to populate the export.
Maatwebsite\Excel\Concerns\FromQueryUse an Eloquent query to populate the export.From Query
Maatwebsite\Excel\Concerns\FromViewUse a (Blade) view to populate the export.From View
Maatwebsite\Excel\Concerns\HasReferencesToOtherSheetsAllows precalculated values where one sheet has references to another sheet.References to other sheets
Maatwebsite\Excel\Concerns\ShouldAutoSizeAuto-size the columns in the worksheet.Auto size
Maatwebsite\Excel\Concerns\WithChartsAllows to run one or multiple PhpSpreadsheet Chart instances.Charts
Maatwebsite\Excel\Concerns\WithColumnFormattingFormat certain columns.Formatting columns
Maatwebsite\Excel\Concerns\WithColumnWidthsSet Column widths.Column widths
Maatwebsite\Excel\Concerns\WithCustomChunkSizeAllows Exportables to define their chunk size.
Maatwebsite\Excel\Concerns\WithCustomCsvSettingsAllows to run custom Csv settings for this specific exportable.Custom CSV Settings
Maatwebsite\Excel\Concerns\WithCustomQuerySizeAllows Exportables that implement the FromQuery concern to provide their own custom query size.Custom Query Size
Maatwebsite\Excel\Concerns\WithCustomStartCellAllows to specify a custom start cell. Do note that this is only supported for FromCollection exports.Custom start cell
Maatwebsite\Excel\Concerns\WithCustomValueBinderAllows to specify a custom value binder.Custom Value Binder
Maatwebsite\Excel\Concerns\WithDrawingsAllows to run one or multiple PhpSpreadsheet (Base)Drawing instances.Drawings
Maatwebsite\Excel\Concerns\WithEventsRegister events to hook into the PhpSpreadsheet process.Events
Maatwebsite\Excel\Concerns\WithHeadingsPrepend a heading row.Adding a heading row
Maatwebsite\Excel\Concerns\WithMappingFormat the row before it's written to the file.Mapping data
Maatwebsite\Excel\Concerns\WithMultipleSheetsEnable multi-sheet support. Each sheet can have its own concerns (except this one).Multiple Sheets
Maatwebsite\Excel\Concerns\WithPreCalculateFormulasForces PhpSpreadsheet to recalculate all formulae in a workbook when saving, so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet viewer when opening the file.
Maatwebsite\Excel\Concerns\WithPropertiesAllows setting properties on the document.Properties
Maatwebsite\Excel\Concerns\WithStrictNullComparisonUses strict comparisons when testing cells for null value.Strict null comparisons
Maatwebsite\Excel\Concerns\WithStylesAllows setting styles on worksheets.Styles
Maatwebsite\Excel\Concerns\WithTitleSet the Workbook or Worksheet title.Multiple Sheets

Traits ​

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