New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation errors are not passed as props #52
Comments
Inertia doesn't automatically include validation errors, but you can use Inertia::share([
'errors' => function () {
return Session::get('errors')
? Session::get('errors')->getBag('default')->getMessages()
: (object) [];
]); |
Hello @mohd-isa! Thanks for your interest in Inertia. I think you will find this response I gave on Twitter helpful regarding error handling. 👍 Question:
Answer:
|
I am doing a simple login form, using the existing login logic of LoginController@login
The request hits the controller successfully, but when there is validation failure, the response is always missing props. In this case I am not able to get the validation errors.
response sample:
this is my vue code
and the html login form is very simple:
Also I am using the latest version of each package:
inertia 0.1.3
inertia-vue 0.1.1
inertia-laravel 0.1.0
The text was updated successfully, but these errors were encountered: