src/Console/Commands/Theme.php
public function handle()
    {
        if (! SetupHelper::isInstalled()) {
            $this->line(PHP_EOL.'<error>[✘]</error> Canvas has not been installed yet.');
            $this->line(PHP_EOL.'For installation instructions, please visit cnvs.readme.io.'.PHP_EOL);
            die();
        }

        $themeManager = new ThemeManager(resolve('app'), resolve('files'));
        $activeTheme = $themeManager->getTheme($themeManager->getActiveTheme()) ?: $themeManager->getDefaultTheme();
        $newThemeId = $this->argument('theme');

        if ($newThemeId) {
            if ($newTheme = $themeManager->getTheme($newThemeId)) {
                $themeManager->activateTheme($newThemeId);
                $activeTheme = $newTheme;
                $this->comment(PHP_EOL."<info>[✔]</info> Successfully activated theme {$newTheme->getName()}!");
            } else {
                $this->line(PHP_EOL."<error>[✘]</error> Could not activate theme ($newThemeId). Theme not found!");
            }
        }

        // Display results
        $this->line('');
        $headers = ['Active Theme', 'Version'];
        $data = [[$activeTheme->getName(), $activeTheme->getVersion()]];
        $this->table($headers, $data);
        $this->line(PHP_EOL.'For more information on theme development, please visit cnvs.readme.io/docs/theme-overview.'
            .PHP_EOL);
    }
public function handle()
    {
        if (! SetupHelper::isInstalled()) {
            $this->line(PHP_EOL.'<error>[✘]</error> Canvas has not been installed yet.');
            $this->line(PHP_EOL.'For installation instructions, please visit cnvs.readme.io.'.PHP_EOL);
            die();
        }

        $themeManager = new ThemeManager(resolve('app'), resolve('files'));
        $activeTheme = $themeManager->getTheme($themeManager->getActiveTheme()) ?: $themeManager->getDefaultTheme();
        $newThemeId = $this->argument('theme');

        if ($newThemeId) {
            if ($newTheme = $themeManager->getTheme($newThemeId)) {
                $themeManager->activateTheme($newThemeId);
                $activeTheme = $newTheme;
                $this->comment(PHP_EOL."<info>[✔]</info> Successfully activated theme {$newTheme->getName()}!");
            } else {
                $this->line(PHP_EOL."<error>[✘]</error> Could not activate theme ($newThemeId). Theme not found!");
            }
        }

        // Display results
        $this->line('');
        $headers = ['Active Theme', 'Version'];
        $data = [[$activeTheme->getName(), $activeTheme->getVersion()]];
        $this->table($headers, $data);
        $this->line(PHP_EOL.'For more information on theme development, please visit cnvs.readme.io/docs/theme-overview.'
            .PHP_EOL);
    }
Execute the console command.

@return mixed