首个解决方案:https://laravel.com/docs/5.4/authentication#authenticating-users
二解决方案:
1:就在LoginController.php
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password])) {
// Authentication passed...
return redirect()->intended('dashboard');
} else if(Auth::attempt(['email' => $email, 'password' => $old_password]) {
return redirect()->intended('dashboard');
}
}
检查覆盖public function authenticate()
运行php artisan event:generate
产生laravel事件。
2:运行php artisan make:event CheckOldPassword
3:添加事件在EventServiceProvider.php 'Illuminate\Auth\Events\Failed' => ['App\Listeners\CheckOldPassword'],
4:创建功能public function handle(Failed $event){}
5:手动检查登录事件。