laravel验证语法错误


laravel validation syntax error

堆栈跟踪:异常"Symfony''Component''Debug''exception''FatalErrorException",在D:''examplep''htdocs''guestlara''app''controllers''LoginController.php:23 中显示消息"语法错误,意外的"}"

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('/');
        }
    }

}

缺少;-

        return Redirect::to('/')
               ->withErrors($validator);
        log::error($validator); // Here
    } else {

零钱很少。

CCD_ 2将不会被执行,因为动作在到达log::error()之前将CCD_。所以应该是

log::error($validator);
return Redirect::to('/')
       ->withErrors($validator);

日志中缺少分号:error($validator)