Latest

Thursday, July 6, 2017

how to return a json response of validation in laravel

Asked by: Armin21


Validation code

 $this->validate($request, [
            'email'=> 'required|email|unique:users',
            'email'=> 'required|max:120',
            'password' => 'required|min:4'
            ]);

how can i return the errors of validation if they exist as a json response?



Source

No comments:

Post a Comment

Adbox