Customize exports using Closures
mainMany customization methods on the ExcelExport class accept a Closure. This allows you to inject dynamic data into your export configuration. The following arguments are available within these Closures:
$livewire: The Livewire component instance (not available for queued exports).$livewireClass: The class name of the Livewire component.$resource: The Resource class.$model: The Model class.$recordIds: The IDs of the selected records (used in Bulk Actions).$query: The Eloquent query builder instance.
use pxlrbt\FilamentExcel\Actions\Tables\ExportAction;
use pxlrbt\FilamentExcel\Exports\ExcelExport;
ExportAction::make()->exports([
ExcelExport::make('table')->withFilename(fn ($resource) => $resource::getLabel()),
])