我使用Laravel创建应用程序,Laravel登录认证的问题,我用“管理员”表来存储管理员,如何登录为管理员进行身份验证,不同命名的表
我做了这样的用户的“用户”表验证,
$input = Input::all();
$rules = array('email' => 'required|email', 'password' => 'required');
$v = Validator::make($input, $rules);
if ($v->fails()) {
return Redirect::to('login')->withErrors($v);
} else {
$user_email = $input['email'];
$user_password = $input['password'];
$credentials = array('email' => $user_email, 'password' => $user_password);
if (Auth::attempt($credentials)) {
return Redirect::to('dashboard');
} else {
return Redirect::to('login')
->with('global', 'Please Register First');
}
}
但如何使用这个“管理员”表认证。
[使用2个不同表的身份验证](http:// stackoverflow。com/questions/18785754/authentication-with-2-different-tables) – 2014-10-16 10:38:14
对于所有用户(称为管理员而不是默认用户)是否使用单个表,还是尝试在网站的两个部分中实施auth一个使用默认用户的东西,另一个使用管理员)? – alexrussell 2014-10-16 10:57:23