How to add action who requires confirmation in modal extra actions
Hi everyone,
I have a modal like this
public function editActivityForm(Form $form): Form
{
return $form
->schema([
Actions::make([
Action::make('editTask')
->form([
TextInput::make('name')
->required(),
Textarea::make('description'),
DatePicker::make('start_date')
->required(),
DatePicker::make('end_date')
->required()
])
->fillForm(fn () =>
$this->activities[array_search(
$this->editActivityId,
array_column($this->activities, 'id')
)])
->modalCancelAction(false)
->extraModalFooterActions(fn () => [
Action::make('Delete task')
->button()
->color('danger')
->requiresConfirmation()
->action(
fn () => $this->deleteTask()
)
])
->action(fn (array $data) => $this->editTask($data))
])
]);
}
but whenever I try to use 'extraModalFooterActions' I get the following error:
https://flareapp.io/share/B5ZZGOp5Flare
Typed property Filament\Forms\Components\Actions\Action::$component must not be accessed before initialization - The error occurred at https://sersedil.localhost/admin/projects/26
0 Replies