public function clear_redis_cache()
    {

        $redis_host = config('database.redis.default.host');
        $redis_port = config('database.redis.default.port');

        $this->info('Clearing the Redis Cache at: ' . $redis_host . ':' . $redis_port);

        try {

            $redis = new Client([
                'host' => $redis_host,
                'port' => $redis_port,
            ]);
            $redis->flushall();
            $redis->disconnect();

        } catch (Exception $e) {

            $this->error('Failed to clear the Redis Cache. Error: ' . $e->getMessage());

        }

    }
public function clear_redis_cache()
    {

        $redis_host = config('database.redis.default.host');
        $redis_port = config('database.redis.default.port');

        $this->info('Clearing the Redis Cache at: ' . $redis_host . ':' . $redis_port);

        try {

            $redis = new Client([
                'host' => $redis_host,
                'port' => $redis_port,
            ]);
            $redis->flushall();
            $redis->disconnect();

        } catch (Exception $e) {

            $this->error('Failed to clear the Redis Cache. Error: ' . $e->getMessage());

        }

    }
public function clear_redis_cache ( ) { $ redis_host = config ( 'database.redis.default.host' ) ; $ redis_port = config ( 'database.redis.default.port' ) ; $ this -> info ( 'Clearing the Redis Cache at: ' . $ redis_host . ':' . $ redis_port ) ; try { $ redis = new Client ( [ 'host' => $ redis_host , 'port' => $ redis_port , ] ) ; $ redis -> flushall ( ) ; $ redis -> disconnect ( ) ; } catch ( Exception $ e ) { $ this -> error ( 'Failed to clear the Redis Cache. Error: ' . $ e -> getMessage ( ) ) ; } }
Flush all keys in Redis.
Flush all keys in Redis .