where('type', RegistryType::MANAGED->value) ->findOrFail((int) $this->argument('registry')); $buildServer = $this->option('build-server') ? Server::query() ->where('organisation_id', $registry->organisation_id) ->findOrFail((int) $this->option('build-server')) : null; $runtimeServers = collect($this->option('runtime-server')) ->map(fn (string $serverId): Server => Server::query() ->where('organisation_id', $registry->organisation_id) ->findOrFail((int) $serverId)); $operation = $operations->execute($registry, $buildServer, $runtimeServers); $this->info("Created registry smoke-check operation {$operation->id}."); if ($this->option('dispatch')) { $operation->steps()->orderBy('order')->first()?->dispatchJob(); $this->info('Dispatched registry smoke-check operation.'); } return self::SUCCESS; } }