本文整理汇总了PHP中Illuminate\Support\Facades\Auth::verify方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::verify方法的具体用法?PHP Auth::verify怎么用?PHP Auth::verify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Auth
的用法示例。
在下文中一共展示了Auth::verify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postLogin
public function postLogin(Request $request)
{
try {
$input = $request->all();
$credentials = array('email' => $input['email'], 'password' => $input['password']);
$email = $input['email'];
$password = $input['password'];
/* Auth::attempt(array(
'identifier' => 'admin',
'password' => 'admin'
));*/
// Auth::();
switch (Auth::verify(array('email' => $email, 'verified' => 1, 'password' => $password), true)) {
case Verify::SUCCESS:
return Redirect::intended('/dashboard');
break;
case Verify::INVALID_CREDENTIALS:
\Session::flash("error_message", "Invalid Credentials");
return Redirect::back();
break;
case Verify::UNVERIFIED:
\Session::flash("error_message", "Unverified User");
return Redirect::back();
break;
case Verify::DISABLED:
\Session::flash("error_message", "User Disabled");
return Redirect::back();
break;
}
/*if (Auth::attempt(array('email' => $email,'verified'=>1, 'password' => $password),true))
{
$user = User::find(Auth::user()->id);
if ($user->verified) {
//return Redirect::to($redirect);
return Redirect::intended('backend/dashboard/index');
} else {
// Redirect to homepage
// return Redirect::to('your_default_logged_in_page')->with('success', 'You have logged in successfully');
}
}*/
} catch (Exception $e) {
\Session::flash("error_message", $e->getMessage());
return \Redirect::back();
}
}