Authentication 是否有一种自定义laravel auth的方法来验证用户是否预先存储在旧表中?
我正在将一个纯PHP应用程序重构到Laravel。我已经做了拉威尔·奥特。它起作用了。但是,我需要一种将旧用户和密码迁移到新表的方法。我的想法是,在登录后,验证用户是否存储在旧表中,如果是,则在新表中插入该用户,并使用laravel auth进行处理。我可以在LoginController中重写登录的方法来进行这些更改吗?可能吗?我不得不覆盖登录方法,添加函数migrationUserModelInternet($request) 受保护的功能登录(请求$Request){Authentication 是否有一种自定义laravel auth的方法来验证用户是否预先存储在旧表中?,authentication,customization,laravel-5.6,Authentication,Customization,Laravel 5.6,我正在将一个纯PHP应用程序重构到Laravel。我已经做了拉威尔·奥特。它起作用了。但是,我需要一种将旧用户和密码迁移到新表的方法。我的想法是,在登录后,验证用户是否存储在旧表中,如果是,则在新表中插入该用户,并使用laravel auth进行处理。我可以在LoginController中重写登录的方法来进行这些更改吗?可能吗?我不得不覆盖登录方法,添加函数migrationUserModelInternet($request) 受保护的功能登录(请求$Request){ $this-
$this->validateLogin($request);
$this->migrationUserModelInternet($request);
// If the class is using the ThrottlesLogins trait, we can automatically throttle
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
if ($this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
if ($this->attemptLogin($request)) {
return $this->sendLoginResponse($request);
}
// If the login attempt was unsuccessful we will increment the number of attempts
// to login and redirect the user back to the login form. Of course, when this
// user surpasses their maximum number of attempts they will get locked out.
$this->incrementLoginAttempts($request);
return $this->sendFailedLoginResponse($request);
}