how to get selected table record inside list page resource
class ListStoks extends ListRecords
{
protected static string $resource = StokResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
Action::make('Export')
->color('info')
->icon('heroicon-o-arrow-down-tray')
->action(function ($livewire) {
dd($livewire->getSelectedTableRecords());
$name = "laporan-stock-barang-" . date('d-m-y H:i:s') . ".csv";
return Excel::download(new StockExport(), $name, \Maatwebsite\Excel\Excel::CSV);
})
->openUrlInNewTab(),
];
}
}
but showing null4 Replies
not sure but maybe you just want to used the build in export?
https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export
im using laravel export libs
because im needing mapping data into html
Sorry im not sure, maybe someone else would have an idea.
I do know it would work fine if you use a bulk action, then you just get a collection of all the selected objects.
Or if you dont care about any filters you could just query the modal in the header action
i just need getselectedtablerecords working