F
Filamentβ€’2y ago
Crylar

How can I update a form input on action?

I have action button on edit page and would like to update a particular input on edit form. How can I do this?
Actions\Action::make('status.confirm')
->button()
->action(function () {
if ($this->record->status == OrderStatus::PAID) {
$this->record->status = OrderStatus::CONFIRMED;
$this->record->save();
}
}),
Actions\Action::make('status.confirm')
->button()
->action(function () {
if ($this->record->status == OrderStatus::PAID) {
$this->record->status = OrderStatus::CONFIRMED;
$this->record->save();
}
}),
and field on the form right now
Forms\Components\Select::make('status')
->reactive()
->required(),
Forms\Components\Select::make('status')
->reactive()
->required(),
2 Replies
Crylar
CrylarOPβ€’2y ago
Oh how did I miss this, thanks. πŸ™‚
Want results from more Discord servers?
Add your server