Skip to content

Commit 85b9b95

Browse files
authored
fix(ServiceProvider): resolve LockProvider binding for Laravel 12 (#13)
1 parent df8a346 commit 85b9b95

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Providers/IdempotencyServiceProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ function (Application $app): IdempotencyConfig {
8585
$this->app->singleton(
8686
IdempotencyCacheManager::class,
8787
function (Application $app): IdempotencyCacheManager {
88+
$cacheRepository = $this->getCacheRepository($app);
89+
8890
/** @var LockProvider $lockProvider */
89-
$lockProvider = $app->make(LockProvider::class);
91+
$lockProvider = $cacheRepository->getStore();
9092

91-
return new IdempotencyCacheManager($this->getCacheRepository($app), $lockProvider, $this->getConfig($app));
93+
return new IdempotencyCacheManager($cacheRepository, $lockProvider, $this->getConfig($app));
9294
}
9395
);
9496

tests/TestCase.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ protected function getPackageProviders($app): array
2424

2525
protected function getEnvironmentSetUp($app): void
2626
{
27-
$app->singleton(\Illuminate\Contracts\Cache\LockProvider::class, function ($app) {
28-
return $app->make(\Illuminate\Cache\ArrayStore::class);
29-
});
30-
3127
$app->singleton('cache', function ($app) {
3228
return new \Illuminate\Cache\Repository(
3329
new \Illuminate\Cache\ArrayStore

0 commit comments

Comments
 (0)