argument('workspace'); $systemOnly = $this->option('system'); if ($systemOnly) { $this->info('Priming system config cache...'); $config->prime(null); $this->info('System config cached.'); return self::SUCCESS; } if ($workspaceSlug) { if (! class_exists(Workspace::class)) { $this->error('Tenant module not installed. Cannot prime workspace config.'); return self::FAILURE; } $workspace = Workspace::where('slug', $workspaceSlug)->first(); if (! $workspace) { $this->error("Workspace not found: {$workspaceSlug}"); return self::FAILURE; } $this->info("Priming config cache for workspace: {$workspace->slug}"); $config->prime($workspace); $this->info('Workspace config cached.'); return self::SUCCESS; } $this->info('Priming config cache for all workspaces...'); if (! class_exists(Workspace::class)) { $this->warn('Tenant module not installed. Only priming system config.'); $config->prime(null); $this->info('System config cached.'); return self::SUCCESS; } $this->withProgressBar(Workspace::all(), function ($workspace) use ($config) { $config->prime($workspace); }); $this->newLine(); $this->info('All config caches primed.'); return self::SUCCESS; } }