用户登录laravel 4 [英] user login laravel 4
本文介绍了用户登录laravel 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
无法管理任何人的想法吗?我仍然被重定向回登录页面
can't manage to login anybody an idea? i still get redirected back to the login page
Route::post('login', function() {
// get POST data
$email = Input::get('username');
$password = Input::get('password');
if ( Auth::attempt(array('email' => $email,'password' => $password) ))
{
return Redirect::to('home');
}
else
{
// auth failure! lets go back to the login
return Redirect::to('login')
->with('login_errors', true);
}
});
推荐答案
更改
if ( Auth::attempt(array('email' => $email,'password' => $password) ))
到
if ( Auth::attempt(array('username' => $email,'password' => $password) ))
这篇关于用户登录laravel 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文