Skip to content

Commit 83be17a

Browse files
authored
Merge pull request #17 from akalongman/feature/register-ratelimiter
Register Laravel's rate-limiter as a singleton
2 parents 89c6d69 + 450a952 commit 83be17a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Lodash/Cache/CacheServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Longman\LaravelLodash\Cache;
66

77
use Illuminate\Cache\MemcachedConnector;
8+
use Illuminate\Cache\RateLimiter;
89
use Illuminate\Support\ServiceProvider;
910

1011
class CacheServiceProvider extends ServiceProvider
@@ -34,6 +35,8 @@ public function register(): void
3435
$this->app->singleton('memcached.connector', static function () {
3536
return new MemcachedConnector();
3637
});
38+
39+
$this->app->singleton(RateLimiter::class);
3740
}
3841

3942
/**
@@ -47,6 +50,7 @@ public function provides()
4750
'cache',
4851
'cache.store',
4952
'memcached.connector',
53+
RateLimiter::class,
5054
];
5155
}
5256
}

0 commit comments

Comments
 (0)