We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7171b99 commit b369784Copy full SHA for b369784
src/Throttle.php
@@ -71,9 +71,8 @@ class Throttle
71
* @param Cache $cache
72
* @param Config $config
73
*/
74
- public function __construct(Cache $cache, Config $config)
+ public function __construct(Config $config)
75
{
76
- $this->cache = $cache;
77
$this->config = array_merge(static::$default_config, $config->load('throttle', 'throttle'));
78
}
79
@@ -126,6 +125,8 @@ protected function allowRequest(Request $request)
126
125
127
public function handle(Request $request, Closure $next)
128
+ $this->cache = app('cache');
129
+
130
$allow = $this->allowRequest($request);
131
if (!$allow) {
132
// 访问受限
0 commit comments