我在laravel 5.4上创建了自定义登录身份验证。一切正常。但是,我想将登录尝试不在我的网站上运行并且包含错误。限制在Laravel 5.4中自定义登录的登录尝试
我在下面的laravel 5.0上运行的其他站点上看到了下面的代码,但未在laravel 5.4上运行。
use Illuminate\Foundation\Auth\ThrottlesLogins;
use App\Http\Controllers\Auth\RegisterController;
class AuthCustomController extends Controller
{
use AuthenticatesAndRegistersUsers, ThrottlesLogins ;
protected $maxLoginAttempts = 3;
protected $lockoutTime = 20;
public function loginCustom()
{
//codes here
}
}
错误:
Trait 'App\Http\Controllers\AuthenticatesAndRegistersUsers' not found
有谁知道?
您正在使用什么版本? https://laracasts.com/discuss/channels/laravel/authenticatesandregistersusers-trait-removed-from-53 - 否则只需在您的使用声明中添加命名空间。 –
你有包括AuthenticatesAndRegistersUsers使用使用 – iCoders
我使用5.4。,在谷歌的答案低于5.4这是行不通的 – smzapp