F
Filament7mo ago
dasK_

3.2 Exporting CSV

Just upgraded to 3.2 so I can use the export action but hitting a wall when trying to add the ExportAction to getHeaderActions, it seems to work just fine in the table, but it just doesn't work in the header? protected function getHeaderActions(): array { return [ Actions\CreateAction::make(), ImportAction::make() ->importer(ProductImporter::class), ExportAction::make() ->exporter(ProductExporter::class) ]; } Removing ImportAction and leaving just Export still does the same thing. Header actions must be an instance of Filament\Actions\Action, or Filament\Actions\ActionGroup.
Solution:
You need to read docs clearly, everything is written here.. Outside table you use use Filament\Actions\ExportAction; and inside table you use use Filament\Tables\Actions\ExportAction; Notice the difference
No description
Jump to solution
3 Replies
dasK_
dasK_7mo ago
adding ImportAction to the table headerActions gives me this error Method Filament\Actions\ImportAction::table does not exist. looks like I have to put Import in the getHeaderActions and export in the actual table.. weird
Solution
Vp
Vp7mo ago
You need to read docs clearly, everything is written here.. Outside table you use use Filament\Actions\ExportAction; and inside table you use use Filament\Tables\Actions\ExportAction; Notice the difference
No description
dasK_
dasK_7mo ago
I'm so dumb. Thanks