laravel:migrations-and-factories

Generate Laravel migration files and factory classes for models.

Updated Sep 25, 2025
One-click install
npx skills add https://github.com/angelgarciasolorzano/social-hub --skill laravel-migrations-and-factories-angelgarciasolorzano
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:migrations-and-factories
Source: https://github.com/angelgarciasolorzano/social-hub/tree/main/.agents/skills/laravel-migrations-and-factories
Command: npx skills add https://github.com/angelgarciasolorzano/social-hub --skill laravel-migrations-and-factories-angelgarciasolorzano

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Manages and ensures safe, testable, and reversible database schema changes by automating the creation of Laravel migrations and corresponding factories.

Core Features & Use Cases

  • Migrations: Automatically generates Laravel migration files for adding new database tables or fields.
  • Factories: Generates corresponding factory classes to build realistic test data for the model.
  • Seeding: Encourages the use of minimal but realistic datasets for seeding data in development environments.
  • Use Case: When adding a new Post model, use the provided command to generate both a migration and a factory.

Quick Start

Run the following command to create a new model 'Post' with migration and factory: sail artisan make:model Post -mfc

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 generate Laravel migrations and model factories at the same time?

Generate Laravel migrations and model factories simultaneously by running `sail artisan make:model Post -mfc`, which automates creating the migration file and factory class for realistic test data generation.

What is the best way to keep Laravel database schema changes testable and reversible?

Laravel database schema changes are kept testable and reversible by automating migration creation alongside model factories, ensuring consistent, predictable schema modifications and realistic dataset seeding in development environments.

How do I create realistic test data for a new Laravel model?

Create realistic test data for a new Laravel model by generating a corresponding factory class, which builds minimal but realistic datasets for seeding data during development and testing.

Can I automate database table creation and test data seeding in Laravel development?

Automate database table creation and test data seeding in Laravel development by generating migration files for new tables or fields and corresponding factory classes for the models.

Do I need Laravel Sail to run migration and factory generation commands?

The provided command uses Laravel Sail (`sail artisan make:model Post -mfc`) to generate migrations and factories, indicating a Sail-based local development environment for executing these database automation tasks.