How to use laravel throttle in second instead of in minute? 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
Route::get("/v0/chat/get/{room}","chatController@chat_get")->middleware('throttle:120,1');
but the ->middleware() overwrite failed. Thanks
You must see ThrottlesLogin.php, at lockoutTime method to understand about lockoutTime.
protected function lockoutTime()
{
return property_exists($this, 'lockoutTime') ? $this->lockoutTime : 60;
}
If you want to custom lockoutTime, init it in your controller $lockoutTime = ???
With this issue, you can use throttle in seconds.
Now it is possible to use float for seconds, like 0.5 = 30 seconds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With