Maybe:
->with(array("messages"=>$this->user->errors));
still
Undefined variable: messages (View:
but i found that in the docs but i cant get it [This is a link]http://laravel.com/docs/validation under named error
Named Error Bags If you have multiple forms on a single page, you may wish to name the MessageBag of errors. This will allow you to retrieve the error messages for a specific form. Simply pass a name as the second argument to withErrors: return Redirect::to('register')->withErrors($validator, 'login');
i found it .. second reply here http://stackoverflow.com/questions/17047116/laravel-validation-attributes-nice-names
return Redirect::route('page')->withErrors(array('register' => $validator));
so i will get it under
{{$errors->register->first('username)}}
i had 2 forms one for login and other for sign up in one page so the variable $errors->first('username') is identical for login and sign up
So as you mentioned with named errors
return Redirect::to('whatever')->withErrors($validator, 'login');
then in the views
{{ $errors->login->first('username') }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community