use Auth;
use Illuminate\Routing\Controller;
class AuthController extends Controller {
/**
* Handle an authentication attempt.
*
* @return Response
*/
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password]))
{
return redirect()->intended('dashboard');
}
}
}
这个Auth门面它是怎么验证的呢?没有数据库查询,没有代码具体可以看啊。。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
如果使用 ide-helper, 可以在
_ide_helper.php中看到这段代码其中
也就是说,这个
attempt方法调用的是\Illuminate\Auth\SessionGuard::attempt($credentials, $remember, $login)方法。具体的登陆验证的逻辑在里面。
config里的auth.php里配置了数据模型的吧,指定了model进行数据查询和匹配