Custom Action that calls "save" doesn't actually save the model
So I'm trying to put a save button elsewhere in an Edit page
Both
payment_method
and balance_used
are properties of the model that is being edited
I tried with both submit('save')
as well as action('save')
, they both trigger the validation and display the success notification, but the model is not updated and neither protected function beforeSave()
or protected function afterSave()
are called.. what am I doing wrong?
My plan was to save the order and then redirect to the payment page in the afterSave
method, I would've used a custom action but I couldn't manage to trigger the validation with that3 Replies
(that commented
afterStateUpdated
was to check if it was actually updated, and yes, it triggered, but still no validation)I think you need to use
->action()
inside Action like below (just copy paste from docs)
Read more here https://filamentphp.com/docs/3.x/actions/overview#what-is-an-actioni'm gonna give that a try, but why am I getting the save notification if the model isn't actually saved?
ah, my custom action didn't run the validations, but I could try doing that manually