Chapter 17 will build a command that rewrites rows, a backfill. Three habits apply to it and to any command that changes data in production.
Laravel, shipping fast.
Chapter 11 · Scheduled Work and Commands