Request Class
class LoginRequest extends FormRequest
{
public function wantsJson() {
return true;
}
public function authorize() {
return true;
}
public function rules() {
$validators = [
'email' => 'required',
'password' => 'required'
];
return $validators;
}
public function failedValidation(\Illuminate\Contracts\Validation\Validator $validator) {
if($validator->fails()) {
//print_r($validator->errors());
//die();
}
return parent::failedValidation($validator);
}
}
I have an api written in Laravel. I am trying to test the validation through Postman extension. When I submit some values of email and password, it works. I get the message that the credentials exists or not.
In case, I don't submit the values, then, there is no json messagebag returned.
I can confirm that there are validation error messages in MessageBag. Here is the screenshot. If the screenshot is not clear then please click it see it.
Another strange things is that the status code returned is 200
Please let me know if you need more info