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
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
I figured this out, apparently the field has to be called
so
data.start_datetime instead of just start_datetimeso
throw ValidationException::withMessages(['data.start_datetime' => "error here"]);