laravel:migrations-and-factories

Align Laravel migrations and factories for safe database schema changes.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-migrations-and-factories-patkik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:migrations-and-factories
Source: https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2/tree/main/.agents/skills/migrations-and-factories
Command: npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-migrations-and-factories-patkik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps database schema changes safe by aligning migrations with factories and providing seeding guidance to ensure deterministic, reproducible deployments.

Core Features & Use Cases

  • Pair each new model with a migration and a factory to guarantee repeatable deployments.
  • Provide seeding guidance and keep datasets minimal, realistic, and externalized where appropriate.
  • Enforce safe branching practices to avoid modifying migrations already merged to main.

Quick Start

Run the recommended artisan command to create a model along with its migration and factory, then migrate the database.

Frequently Asked Questions about laravel:migrations-and-factories

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

FAQPage Schema
How do I safely pair Laravel migrations with factories for database changes?

To safely pair Laravel migrations with factories, run the recommended artisan command that generates a model alongside its migration and factory simultaneously. This guarantees repeatable deployments by keeping schema changes and test data generation aligned across development environments.

What are the best practices for seeding databases in Laravel development workflows?

Database seeding best practices involve keeping datasets minimal, realistic, and externalized where appropriate. Proper seeding ensures deterministic, reproducible deployments by providing structured test data that aligns with your migrations and factories.

When do I need to create a migration and factory together in Laravel?

You need to create a migration and factory together whenever adding a new model to a Laravel application. Pairing them guarantees repeatable deployments and ensures schema changes have coordinated data generation across all environments.

Can I modify a Laravel migration that has already been merged to the main branch?

You should not modify Laravel migrations already merged to main. Safe branching practices require creating new migrations for schema changes instead of altering existing ones, ensuring database evolution remains safe and reproducible across environments.

What is the safest way to manage database schema changes across Laravel development environments?

The safest way to manage database schema changes is by aligning migrations with factories and following structured seeding guidance. This approach enforces safe branching rules and ensures deterministic, reproducible deployments across all development environments.