Skip to content

Concern overview ​

InterfaceExplanationDocumentation
Maatwebsite\Excel\Concerns\FromArrayUse an array to populate the export.Data sources
Maatwebsite\Excel\Concerns\FromCollectionUse a Laravel Collection to populate the export.Data sources
Maatwebsite\Excel\Concerns\FromGeneratorUse a generator to populate the export.Data sources
Maatwebsite\Excel\Concerns\FromIteratorUse an iterator to populate the export.
Maatwebsite\Excel\Concerns\FromQueryUse an Eloquent query to populate the export.Data sources
Maatwebsite\Excel\Concerns\FromScoutUse a Laravel Scout query to populate the export.Data sources
Maatwebsite\Excel\Concerns\FromViewUse a (Blade) view to populate the export.Data sources
Maatwebsite\Excel\Concerns\HasReferencesToOtherSheetsAllows precalculated values where one sheet has references to another sheet.
Maatwebsite\Excel\Concerns\ShouldAutoSizeAuto-size the columns in the worksheet.Presentation
Maatwebsite\Excel\Concerns\WithBackgroundColorSet the default background fill colour for the worksheet.Presentation
Maatwebsite\Excel\Concerns\WithChartsAllows running one or multiple PhpSpreadsheet Chart instances.
Maatwebsite\Excel\Concerns\WithColumnFormattingFormat certain columns.
Maatwebsite\Excel\Concerns\WithColumnsDefine typed columns for exports and imports.Columns
Maatwebsite\Excel\Concerns\WithColumnWidthsSet column widths.Presentation
Maatwebsite\Excel\Concerns\WithCustomChunkSizeAllows Exportables to define their chunk size.
Maatwebsite\Excel\Concerns\WithCustomCsvSettingsAllows running custom CSV settings for this specific exportable.Settings
Maatwebsite\Excel\Concerns\WithCustomQuerySizeAllows Exportables that implement the FromQuery concern to provide their own custom query size.
Maatwebsite\Excel\Concerns\WithCustomStartCellAllows specifying a custom start cell. Only supported for FromCollection exports.Data sources
Maatwebsite\Excel\Concerns\WithCustomValueBinderAllows specifying a custom value binder.Custom Value Binder
Maatwebsite\Excel\Concerns\WithDrawingsAllows running one or multiple PhpSpreadsheet Drawing instances.
Maatwebsite\Excel\Concerns\WithEventsRegister events to hook into the PhpSpreadsheet process.
Maatwebsite\Excel\Concerns\WithHeadingsPrepend a heading row.Presentation
Maatwebsite\Excel\Concerns\WithMappingFormat the row before it's written to the file.Presentation
Maatwebsite\Excel\Concerns\WithMultipleSheetsEnable multi-sheet support. Each sheet can have its own concerns (except this one).
Maatwebsite\Excel\Concerns\WithPreCalculateFormulasForces PhpSpreadsheet to recalculate all formulae when saving.
Maatwebsite\Excel\Concerns\WithPropertiesAllows setting document properties.Settings
Maatwebsite\Excel\Concerns\WithStrictNullComparisonUses strict comparisons when testing cells for null values.Data sources
Maatwebsite\Excel\Concerns\WithStylesAllows setting styles on worksheets.Presentation
Maatwebsite\Excel\Concerns\WithExportTemplateBase an export on an existing spreadsheet file, preserving its styles, formulas and extra sheets.Export Templates
Maatwebsite\Excel\Concerns\WithTitleSet the Workbook or Worksheet title.
Maatwebsite\Excel\Concerns\ShouldBatchDispatch queued exports or chunked imports as a job batch instead of a chain.Performance
Maatwebsite\Excel\Concerns\ShouldQueueWithoutChainDispatch each import chunk independently rather than as a chain.Queued imports

Traits ​

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