[英]Laravel Throttle overwrite in second
How to use laravel throttle in second instead of in minute?如何在秒而不是分钟内使用 laravel 油门? I want to use this for chat app, and i think limiting it to second will be better.
我想将它用于聊天应用程序,我认为将它限制为秒会更好。
and i tried to overwrite the laravel middleWareGroup throttle with this我试图用这个覆盖 laravel middleWareGroup 油门
Route::get("/v0/chat/get/{room}","chatController@chat_get")->middleware('throttle:120,1');
but the ->middleware() overwrite failed.但 ->middleware() 覆盖失败。 Thanks
谢谢
You must see ThrottlesLogin.php, at lockoutTime method to understand about lockoutTime.您必须在lockoutTime方法中查看 ThrottlesLogin.php 以了解 lockoutTime。
protected function lockoutTime()
{
return property_exists($this, 'lockoutTime') ? $this->lockoutTime : 60;
}
If you want to custom lockoutTime, init it in your controller $lockoutTime =???如果您想自定义锁定时间,请在您的 controller $lockoutTime =???
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.