manage-seeders
Installation
SKILL.md
Database Seeder Manager Skill
Use this skill to create or refactor Seeders, especially when moving from hardcoded data to JSON files or factories.
Core Rules
1. Idempotency (Run Multiple Times Safe)
- Seeders MUST be safe to run multiple times without creating duplicate dirty data.
- Use
updateOrCreateorfirstOrCreatebased on a unique key (e.g.,slug,email,code).
2. JSON Data Source Pattern
When populating data from JSON files (e.g., database/data/*.json):
- Read File: Use
file_get_contentsandjson_decode. - Iterate: Loop through the array.
- Persist: Use
updateOrCreate.