在D:\ xampp \ htdocs \ guestlara \ app \ controllers \ LoginController中堆棧跟蹤:異常'Symfony \ Component \ Debug \ Exception \ FatalErrorException'消息'syntax error,unexpected'}' .PHP:23laravel驗證語法錯誤
public function login_user()
{
$rules = array(
'email'=> 'Required|Between:3,64|Email|Unique:users',
'password'=>'Required|AlphaNum|Between:4,8|Confirmed',
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
// get the error messages from the validator
$messages = $validator->messages();
// redirect our user back to the form with the errors from the validator
return Redirect::to('/')
->withErrors($validator);
log::error($validator)
}
else
{
// attempt to do the login
if (Auth::attempt($users)) {
return Redirect::to('dashboard');
} else {
return Redirect::to('/');
}
}
}
這是PHP語言的語法錯誤。這與Laravel及其驗證都沒有共同之處。 – Rolice