I need help in Laravel 5.1 on how to name MessageBag errors, letting me get error messages for a specific form.
This can be achieved in the controller storage method without using a request.
Laravel 5.1 docs
return redirect('register')
->withErrors($validator, 'login');
But I use RegisterRequest, so I do not need to check any data inside my controller. I just need to set my rules in the request.
I tried this line of codes added to my request
protected function formatErrors(Validator $validator)
{
return $validator->errors()->getMessages('registration');
}
source
share