I just installed a Laravel Spark v4 - ran spark new project-name
and followed the steps without any errors, the issue is that register form does not show any validation errors, not inline red warnings when input is not filled in or validation after the form is sent, what can be the issue? have not changed the generic register blade files.
When nothing is entered I get response code:
app.js:6175 POST http://127.0.0.1:8000/register 422 (Unprocessable Entity)
And the correct JSON response:
{"message":"The given data was invalid.","errors":{"name":["The name field is required."],"email":["The email field is required."],"password":["The password field is required."],"terms":["The terms must be accepted."]}}
Laravel's basic validation works on register form, but it does not work with AJAX request on login / register forms. Forms itself works when registering new users - but no feedback to the user.
I believe this has to do with Laravel's "Consistent Exception Handling" under the hood. The VueJS application for Spark isn't yet taking this into consideration.
To fix locally, around line 54 of
/spark/resources/assets/js/forms/errors.js
, in thethis.set
function, change:to
Recompile your JS, and it should begin working again.