laravel-migration-workflow

Guides Laravel database migrations, schema changes, factories, and seeders with safe rollback practices.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/pd-phuc/laravel-template --skill laravel-migration-workflow-pd-phuc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: laravel-migration-workflow
Source: https://github.com/pd-phuc/laravel-template/tree/main/.claude/skills/laravel-migration-workflow
Command: npx skills add https://github.com/pd-phuc/laravel-template --skill laravel-migration-workflow-pd-phuc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents common Laravel database mistakes such as editing already-run migrations, unsafe column drops, and missing indexes by providing proven migration, factory, and seeder patterns. ## Core Features & Use Cases - Migration Templates: Standardized patterns for creating tables with foreign keys, indexes, soft deletes, and status columns. - Safe Schema Changes: Enforces the rule of never modifying executed migrations, with naming conventions for add, remove, rename, and index operations. - Factories & Seeders: Factory state methods and seeder structures for generating consistent test and admin data. - Danger Checklist: A risk table for destructive operations like dropColumn, renameColumn, and migrate:fresh requiring user confirmation. - Use Case: When adding a phone column to the users table, generate a new add_phone_to_users_table migration with proper up/down methods instead of editing the original migration. ## Quick Start Ask the AI to create a new Laravel model with migration, factory, and controller following the migration workflow conventions.

Frequently Asked Questions about laravel-migration-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a model with migration and factory in Laravel?▼

Run php artisan make:model Product -mfc to generate the model, migration, factory, and controller in one command. This ensures all related files follow consistent naming and are wired together from the start.

How to add a column to an existing Laravel table?▼

Create a new migration with php artisan make:migration add_phone_to_users_table and use Schema::table with the new column in up() and dropColumn in down(). Never modify a migration that has already been executed.

What are Laravel migration naming conventions?▼

Use create_products_table for new tables, add_phone_to_users_table for columns, remove_field_from_table for deletions, and create_product_tag_table for pivot tables in alphabetical order. Consistent names make migration intent clear.

Is it safe to run migrate:fresh in production?▼

No, migrate:fresh drops all tables and destroys all data, so it must only be used in development. In production, use incremental migrations with proper down() methods and always confirm destructive operations first.

How do Laravel factory states work for testing?▼

Define state methods like draft() or archived() in the factory that return modified attributes via $this->state(). You can then call Product::factory()->draft()->create() to generate records with specific variations.