나는 간단한 인증 양식을 laravel로 작성하고 있습니다.
두 개의 다른 자습서를 시도한 후에도 여전히 false가 반환됩니다.
등록이 정상적으로 작동하지만 로그인 정보가 올바르지 않습니다.
다음은 인 LoginController입니다 :허위 반환 false Laravel 4
public function getLogin() {
$this->layout->content = View::make('user.login');
}
public function postSignin() {
if (Auth::attempt(array('email'=>Input::get('email'), 'password'=>Input::get('password'))))
{
return Redirect::to('user/dashboard')->with('message', 'You are now logged in!');
}
else
{
return Redirect::to('user/login')
->with('message', 'Your username/password combination was incorrect')
->withInput();
}
}
public function getDashboard() {
$this->layout->content = View::make('user.dashboard');
}
경로 :
Route::controller('user', 'UserController');
하고 뷰 :
양식에
{{ Form::open(array('url'=>'user/signin', 'class'=>'form-signin')) }}
<h2 class="form-signin-heading">Please Login</h2>
{{ Form::text('username', null, array('class'=>'input-block-level', 'placeholder'=>'Username')) }}
{{ Form::password('password', array('class'=>'input-block-level', 'placeholder'=>'Password')) }}
{{ Form::submit('Login', array('class'=>'btn btn-large btn-primary btn-block'))}}
{{ Form::close() }}