/** * Create an instance of the Redis cache driver. * * @param array $config * * @return \Illuminate\Cache\RedisStore|\Illuminate\Cache\FileStore */ protected function createRedisDriver(array $config) { $redis = $this->app['redis']; $connection = \Illuminate\Support\Arr::get($config, 'connection', 'default') ?: 'default'; $store = new RedisStore($redis, $this->getPrefix($config), $connection); try { $store->getRedis()->ping(); return $this->repository($store); } catch (Exception $e) { event('redis.unavailable', null); return parent::createFileDriver(\Config::get('cache.stores.file')); } }