option('status')) { return $this->reportStatus(); } if ($this->option('up')) { Maintenance::disable(); $this->components->info('The public site is back.'); return self::SUCCESS; } $message = $this->option('message'); $until = $this->option('until'); Maintenance::enable( message: filled($message) ? [config('locales.default') => $message] : null, until: filled($until) ? CarbonImmutable::parse($until) : null, ); $this->components->warn('The public site is now in maintenance.'); $this->components->bulletList(array_filter([ 'Visitors get 503 with the notice; the panel and admin API are unaffected.', filled($until) ? 'Lifts automatically at '.Maintenance::until()?->toDateTimeString() : null, 'The team can still see the real site via the preview token or a trusted IP.', ])); return self::SUCCESS; } protected function reportStatus(): int { if (! Maintenance::isEnabled()) { $this->components->info('The public site is up.'); return self::SUCCESS; } $this->components->warn('The public site is in maintenance.'); $this->components->twoColumnDetail('Since', Maintenance::startedAt()?->diffForHumans() ?? '—'); $this->components->twoColumnDetail('Lifts at', Maintenance::until()?->toDateTimeString() ?? 'manually'); $this->components->twoColumnDetail('Notice', Maintenance::message()); return self::SUCCESS; } }