registrationStatusService->disableExpiredPeriods(); if ($expiredPeriods->isEmpty()) { $this->info('No expired registration periods found.'); return Command::SUCCESS; } foreach ($expiredPeriods as $period) { $this->line(sprintf( 'Marked registration period as done: %s (ended: %s)', $period->name, $period->ends_at->format('Y-m-d H:i') )); } $this->info(sprintf( 'Successfully completed %d expired registration period(s).', $expiredPeriods->count() )); return Command::SUCCESS; } }