我正在尝试限制我的登录尝试但仍无法正常工作
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
use AuthenticatesUsers;
protected $redirectTo = '/home';
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}
}
这是ThrottlesLogin.php
protected function hasTooManyLoginAttempts(Request $request)
{
return $this->limiter()->tooManyAttempts(
$this->throttleKey($request), 3, 2
);
}
我知道在laravel 5.4中,AuthenticatesUsers默认调用thethrottlesLogin,但仍然不限制登录尝试。 并谢谢
答案 0 :(得分:2)
您需要在ThrottlesLogin
LoginController
个特征