/** * Register the service provider. * * @return void */ public function register() { $this->app->bind(RepositoryInterface::class, function ($app) { $cacheStore = $app['cache']->getStore(); $cacheTag = $app['config']->get('responsecache.cache-tag'); return RepositoryFactory::make($cacheStore, $cacheTag); }); $this->app->singleton('responsecache', ResponseCache::class); $this->app[\Illuminate\Routing\Router::class]->middleware('cache', CacheMiddleware::class); $this->app->singleton('command.responsecache:clear', CacheClearCommand::class); $this->commands('command.responsecache:clear'); }
/** * @test */ public function test_returns_simple_cache_if_taggable_store() { $store = new ArrayStore(); $repo = RepositoryFactory::make($store, 'translation'); $this->assertInstanceOf(TaggedRepository::class, $repo); }