📜  如何更改 laravel 8 登录凭据 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:28.255000             🧑  作者: Mango

代码示例1
//add below code to fortify service provider boot function
Fortify::authenticateUsing(function (LoginRequest $request) {
            $user = User::where('user_name', $request->user_name);

            if (
                $user &&
                Hash::check($request->password, $user->password)
            ) {
                return $user;
            }
        });
//and change username in fortify config 
'username' => 'user_name',