© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
jepewsykes

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(),
        ];
    }
}

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
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to get active filters on table inside list resource page widget.
FilamentFFilament / ❓┊help
3y ago
How to get selected record from table in header action?
FilamentFFilament / ❓┊help
3y ago
How to override list resource table query?
FilamentFFilament / ❓┊help
2y ago
Get all selected records inside a custom page
FilamentFFilament / ❓┊help
3y ago