argument('meetup'); $count = 0; Meetup::query() ->when($meetupId, fn ($query) => $query->whereKey($meetupId)) ->chunkById(200, function ($meetups) use (&$count) { foreach ($meetups as $meetup) { $meetup->captureRestorePoint(); $count++; } }); if ($meetupId && $count === 0) { $this->error("Meetup [{$meetupId}] not found."); return Command::FAILURE; } $this->info("Restore points saved for {$count} meetups."); return Command::SUCCESS; } }