How Replacing Hardcoded Seeder Logic with Config Made Deployments Flexible
A developer refactored a Laravel bootstrap seeder that had been hardcoding a single database engine, queue runner, and PHP version, making it impossible to switch stacks without rewriting code. The fix moved all variable parts — database type, queue driver, and PHP version — into a config file, with sensible defaults so a fresh clone still works without a populated environment file. The seeder was also renamed from MvpSeeder to ControlPlaneSeeder, since phase-based names become meaningless once that phase ends, while purpose-based names remain accurate throughout the class's lifetime. Separately, a CI test matrix running PHP 8.3, 8.4, and 8.5 was trimmed to just 8.5, on the principle that deployed applications run a single PHP version and testing others wastes pipeline minutes. The piece argues that seeders encoding real architectural decisions should be covered by tests, and that duplicate workflow runs should be eliminated as a straightforward cost-cutting measure.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in