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:Jump to 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 difference3 Replies
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.. weirdSolution
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 differenceI'm so dumb. Thanks