Intercept validation error messages in the controller #446
-
I have a very simple controller to handle login. it looks like this When i run the controller and i dont pass the required data i get response like this Now my question is this, is there a way to intercept this error, so i can reformat, before sending to the frontend ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We're using the Laravel validator which throws a ValidationException, catching that one and reformatting that one and retrowing it again should probably do the trick. |
Beta Was this translation helpful? Give feedback.
We're using the Laravel validator which throws a ValidationException, catching that one and reformatting that one and retrowing it again should probably do the trick.