I've created a custom filter form for a table on a relation page (i.e. a class which extends ManageRelatedRecords). I have a Select component as part of the filter form and this is populated with a list of projects.
Within a table header action, I'd like to retrieve the list of projects (i.e. Select options), in order to provide navigation to one of the projects in the list. Unfortunately, I'm struggling to access the Select component, so would be grateful to be pointed in the right direction.
public function table(Table $table): Table
{
return $table
->columns([
// ...
])
->filters([
Filter::make('client_project')
->form([
Select::make('client_id'),
Select::make('project_id')
])
->query(function (Builder $query, array $data) {
// ...
}),
])
->headerActions([
Tables\Actions\Action::make('next-project')
->url(function (\Livewire\Component $livewire): string {
$filters = $livewire->getTable()->getFilters();
dd($filters['client_project']);
// how do I retrieve all of the options listed in the 'project_id' Select component?
})
]);
}