scaffold-migration
3
总安装量
3
周安装量
#61534
全站排名
安装命令
npx skills add https://github.com/iurygdeoliveira/labsis-kit --skill scaffold-migration
Agent 安装分布
claude-code
2
windsurf
1
trae
1
codex
1
antigravity
1
Skill 文档
Laravel Migration Scaffold Skill
Use this skill when creating database table definitions.
Rules
1. Anonymous Classes
- Always use
return new class extends Migration.
2. Foreign Keys
- Standard: Use
foreignIdFor()constrained to the model class.$table->foreignIdFor(\App\Models\User::class)->constrained()->cascadeOnDelete(); - Nullable: usage of
->nullable()comes beforeconstrained().
3. ID and UUIDs
- Check if the project or related models use UUIDs.
- If UUID:
$table->uuid('id')->primary(); - If ID:
$table->id();
4. Indexing
- Add indexes to columns that will be frequently searched or used in
WHEREclauses (e.g.,slug,email,status).
Workflow
- Ask: “Does this table relate to existing models?”
- If yes, check the parent model’s ID type (int or uuid) to ensure the foreign key matches.
- Write the migration file.