Zhartaunik
Zhartaunik
FFilament
Created by Zhartaunik on 5/12/2024 in #❓┊help
Table custom query, where from request path.
I have a table with sub-entities. I wan't to display only limited list of sub-entities based on param from request path: http://localhost:3005/admin/events/43
->query(Member::query()
->where('event_id', request()->route()->parameter('record'))
)
->query(Member::query()
->where('event_id', request()->route()->parameter('record'))
)
This renders well, however the form contains one action. When I click on this action:
->actions([
Tables\Actions\Action::make('accept')
->translateLabel()
->action(static fn(Member $record) => $record->approve())
->modalSubmitActionLabel(__('Accept'))
->modalHeading(__('Accept Member'))
->modalContent(fn(Member $record): View => view(
'livewire.show-member',
[
'event' => $record->event,
'record' => $record,
],
))
->hidden(static fn(Member $record) => $record->is_approved),
])
->actions([
Tables\Actions\Action::make('accept')
->translateLabel()
->action(static fn(Member $record) => $record->approve())
->modalSubmitActionLabel(__('Accept'))
->modalHeading(__('Accept Member'))
->modalContent(fn(Member $record): View => view(
'livewire.show-member',
[
'event' => $record->event,
'record' => $record,
],
))
->hidden(static fn(Member $record) => $record->is_approved),
])
The form for some reason is reloading with the request path of POST/PUT action, which doesn't have my argument. The question is: why does it reload the form? Is it the expected behavior of the framework?
6 replies