一键导入
laravel-migrations-and-factories
Safe database change patterns; when to modify vs add migrations; always pair models with migrations and factories; seeding guidance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Safe database change patterns; when to modify vs add migrations; always pair models with migrations and factories; seeding guidance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | laravel:migrations-and-factories |
| description | Safe database change patterns; when to modify vs add migrations; always pair models with migrations and factories; seeding guidance |
Keep schema changes safe, testable, and reversible.
# Create model with migration + factory
sail artisan make:model Post -mfc # or: php artisan make:model Post -mfc
# Run/rollback
sail artisan migrate # or: php artisan migrate
sail artisan migrate:rollback --step=1 # or: php artisan migrate:rollback --step=1
# Fresh DB (dangerous; dev only)
sail artisan migrate:fresh --seed # or: php artisan migrate:fresh --seed
main, never edit it—add a new oneSchema::hasForeignKey('posts', 'posts_user_id_foreign'); use $table->vector('embedding', dimensions: 1536) for pgvector columns (see laravel:vector-search)->state([...])) over boolean flagsbelongsTo) in factories to build realistic graphsRefreshDatabaseBuild AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs
Use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly
Compose UIs with Blade components, slots, and layouts; keep templates pure and testable
Request effective code reviews—specify focus areas, provide context, ask for architectural feedback, reference Laravel conventions
Practical daily checklist for Laravel projects; bring services up, run migrations, queues, quality gates, and tests
Create effective debugging prompts—include error messages, stack traces, expected vs actual behavior, logs, and attempted solutions