diff --git a/src/AnalogueServiceProvider.php b/src/AnalogueServiceProvider.php index ad3f56c..2b50dd8 100755 --- a/src/AnalogueServiceProvider.php +++ b/src/AnalogueServiceProvider.php @@ -8,6 +8,7 @@ use Analogue\ORM\System\Manager; use Illuminate\Contracts\Cache\Repository as CacheRepository; use Illuminate\Support\ServiceProvider; +use Psr\SimpleCache\CacheInterface; /** * Integrate Analogue into Laravel. @@ -51,7 +52,11 @@ public function register() $manager->registerPlugin(\Analogue\ORM\Plugins\Timestamps\TimestampsPlugin::class); $manager->registerPlugin(\Analogue\ORM\Plugins\SoftDeletes\SoftDeletesPlugin::class); - $manager->setCache($app->make(CacheRepository::class)); + // If the cache is pre laravel 5.5, it doesn't implements PSR-16, so we'll skip it. + $cache = $app->make(CacheRepository::class); + if($cache instanceof CacheInterface) { + $manager->setCache($cache); + } return $manager; });