我在windows操作系统中使用laravel,使用MySql作为数据库,并尝试将我的web应用程序的登录连接到laravel的默认登录/注册。登录时在laravel中运行的默认查询是select * from users where email="something",我想知道这个查询的位置,以便根据我喜欢的表格式修改它。任何帮助都将不胜感激。谢谢
发布于 2018-02-09 13:56:14
它通过attemptLogin方法位于AuthenticatesUsers特征中:
/**
* Attempt to log the user into the application.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/
protected function attemptLogin(Request $request)
{
return $this->guard()->attempt(
$this->credentials($request), $request->filled('remember')
);
}实际的实现是通过attempt方法使用卫士完成的:
public function attempt(array $credentials = [], $remember = false)有关示例,请参阅Illuminate\Auth\SessionGuard:
https://github.com/laravel/framework/blob/5.5/src/Illuminate/Auth/SessionGuard.php#L347
https://stackoverflow.com/questions/48699472
复制相似问题