Skip to content

Commit

Permalink
Merge pull request #17 from akalongman/feature/register-ratelimiter
Browse files Browse the repository at this point in the history
Register Laravel's rate-limiter as a singleton
  • Loading branch information
akalongman authored Oct 29, 2020
2 parents 89c6d69 + 450a952 commit 83be17a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Lodash/Cache/CacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Longman\LaravelLodash\Cache;

use Illuminate\Cache\MemcachedConnector;
use Illuminate\Cache\RateLimiter;
use Illuminate\Support\ServiceProvider;

class CacheServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -34,6 +35,8 @@ public function register(): void
$this->app->singleton('memcached.connector', static function () {
return new MemcachedConnector();
});

$this->app->singleton(RateLimiter::class);
}

/**
Expand All @@ -47,6 +50,7 @@ public function provides()
'cache',
'cache.store',
'memcached.connector',
RateLimiter::class,
];
}
}

0 comments on commit 83be17a

Please sign in to comment.