Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
fix instantiation of cache repository
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgoslett committed Jul 4, 2017
1 parent 23c9d23 commit a64c5ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.1 - 2017-07-04

* Fix instantiation of cache repository

## 1.0.0 - 2017-07-03

* Initial release
7 changes: 4 additions & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Superbalist\Laravel4PSR6CacheBridge;

use Illuminate\Cache\Repository;
use Illuminate\Cache\CacheManager;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Psr\Cache\CacheItemPoolInterface;

Expand All @@ -16,8 +16,9 @@ public function register()
$this->app->bind(CacheItemPoolInterface::class, LaravelCacheItemPool::class);

$this->app->bind(LaravelCacheItemPool::class, function ($app) {
$repository = $app->make(Repository::class);
return new LaravelCacheItemPool($repository);
$manager = $app['cache']; /** @var CacheManager $manager */
$cache = $manager->driver();
return new LaravelCacheItemPool($cache);
});
}
}

0 comments on commit a64c5ea

Please sign in to comment.