indra
indra
FFilament
Created by indra on 3/10/2024 in #❓┊help
access filter data from table action or bulk action
Thank you, finally got it working with the following bulk action with custom form , getting the filter value and putting it inside a hidden field, then the other field which requires it using $get method:
BulkAction::make('MyAction')
->mountUsing( function(Forms\ComponentContainer $form, Table $table){
$form->fill([
'myHiddenField' => $table->getFilter('MyFilterName')->getState()['value'],
]);
})
->form([
Forms\Components\Hidden::make('myHiddenField'),
Forms\Components\Select::make('anotherField')
->options(function (Get $get) {
// we can use $get('myHiddenField') here
})
])
...
BulkAction::make('MyAction')
->mountUsing( function(Forms\ComponentContainer $form, Table $table){
$form->fill([
'myHiddenField' => $table->getFilter('MyFilterName')->getState()['value'],
]);
})
->form([
Forms\Components\Hidden::make('myHiddenField'),
Forms\Components\Select::make('anotherField')
->options(function (Get $get) {
// we can use $get('myHiddenField') here
})
])
...
6 replies
FFilament
Created by indra on 3/10/2024 in #❓┊help
access filter data from table action or bulk action
bump
6 replies
FFilament
Created by Abel Cobreros on 8/3/2023 in #❓┊help
EncryptCookies middleware 419 page expired error
Your custom form may need the csrf directive to inject hidden csrf token add
@csrf
@csrf
within your form tag See reference from this docs: https://laravel.com/docs/10.x/csrf
7 replies