Closed Michael-HEIW closed 8 months ago
The merged PR #133 breaks the code if you're adding a header option directly to the table function in the resource like this
->headerActions([
ExportAction::make()->exports( [
ExcelExport::make()->fromTable()
])
])
with version 2.1.7 throws exception "Method pxlrbt\FilamentExcel\Actions\Tables\ExportAction::table does not exist." with version 2.1.6 works
Yes, it seems to be broken.
getHeaderActions()
is a method used for pages, so pxlrbt\FilamentExcel\Actions\Pages\ExportAction
should be used.
pxlrbt\FilamentExcel\Actions\Tables\ExportAction
should be only used like this:
return $table
->columns([...])
->headerActions([
\pxlrbt\FilamentExcel\Actions\Tables\ExportAction::make('myexportaction')->exports([
// export logic
]),
]);
Pull request #133 should be reverted.
Thanks for confirming. I just reverted the PR.
@saulens22 Thanks for pointing out that the wrong Action was used.
Sorry for the problem, that was not my intension.
I tried the return $table->headerAction
it worked perfect.
Following the documentation for Actions\Tables\ExportAction for table header actions, this now throws an exception in Filament v3
This now throws an exception:
The fix is to update pxlrbt/filament-excel/src/Actions/Tables/ExportAction.php
The export action then works as expected.