protected function isCmsEnabledArtisanCommand()
    {
        if (null !== $this->registeredConsoleCommand) {
            // @codeCoverageIgnoreStart
            return $this->registeredConsoleCommand;
            // @codeCoverageIgnoreEnd
        }

        if ( ! $this->isConsole()) {
            $this->registeredConsoleCommand = false;
            return false;
        }

        $command = $this->getArtisanBaseCommand();

        // If no command is given, the CMS will be loaded, to make
        // sure that its commands will appear in the Artisan list.
        if (empty($command)) {
            $this->registeredConsoleCommand = true;
            return true;
        }

        $patterns = $this->getCmsEnabledArtisanPatterns();

        foreach ($patterns as $pattern) {
            if ($command === $pattern || Str::is($pattern, $command)) {
                $this->registeredConsoleCommand = true;
                return true;
            }
        }

        $this->registeredConsoleCommand = false;
        return false;
    }