Khe*_*dju 0 php authentication laravel laravel-8
我已经在 LoginRequest.php 文件中的身份验证功能中更改了它,但它不起作用。
if (! Auth::attempt($this->only('email', 'password', ['active' => 1]), $this->filled('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
Run Code Online (Sandbox Code Playgroud)
该active部分需要添加到传递给 的数组中attempt,该数组需要与从 返回的数组合并only:
Auth::attempt($this->only('email', 'password') + ['active' => 1]) ...
Run Code Online (Sandbox Code Playgroud)