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 null
No description
4 Replies
Marco
Marco5mo ago
jepewsykes
jepewsykesOP5mo ago
im using laravel export libs because im needing mapping data into html
Marco
Marco5mo ago
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
jepewsykes
jepewsykesOP5mo ago
i just need getselectedtablerecords working
Want results from more Discord servers?
Add your server