I was testing this new framework (Laravel) and upto now i'm following those examples which they have put in their documentation. All is going good till i got this problem.
i am calling Redirect::to('\signup')->withErrors($validator->messages());
but its not showing anything
but if i just print it like print_r($validator->messages());
it shows me the errors. Please help me and tell me where i am going wrong?
Controller
public function registerUser(){
$validator = Validator::make(Input::all(),array(
'username' => 'required|email|unique:user',
'password' => 'required|min:8',
'fullname' => 'required'
)
);
if($validator->fails()){
return Redirect::to('signup')->withInput()->withErrors($validator);
}else{
return Redirect::route('user');
}
}
Route
Route::get('/signup',array('as'=>'signup', 'uses'=>'HomeController@signUp'));
View
<?php print_r($errors) ; ?>
The problem was that I changed the secure
option to true in session
file (in config
folder) and was testing it on local server without https
. That is why my errors were not showing in view.