Throwing ValidationException from afterStateUpdated
Hi, is it possible to throw a ValidationException from the afterStateUpdated lifehook on a form field?
Is there any other way to do it using halts?
But this doesnt seem to work. I can send Notifications but I want the validation error to trigger
Solution:Jump to solution
I figured this out, apparently the field has to be called
data.start_datetime
instead of just start_datetime
so
throw ValidationException::withMessages(['data.start_datetime' => "error here"]);
...1 Reply
Solution
I figured this out, apparently the field has to be called
data.start_datetime
instead of just start_datetime
so
throw ValidationException::withMessages(['data.start_datetime' => "error here"]);