scaffold-factory
Installation
SKILL.md
Laravel Factory Scaffold Skill
Use this skill when defining test data generators for Models.
Conventions
1. Sensible Faker Data
- Use
$this->fakermethods that match the column type contextually. - Email:
safeEmail()(never real emails). - Text:
paragraph()orsentence()depending on length. - Enums:
fake()->randomElement(Enum::cases()).
2. State Methods
- Create state methods for every boolean flag or status enum in the model.
- This makes tests readable:
User::factory()->active()->admin()->create().