laravel-migration

Create Laravel migrations with columns, indexes, and foreign keys.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/AdemKao/ai-cowork --skill laravel-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-migration
Source: https://github.com/AdemKao/ai-cowork/tree/main/.ai/stacks/php-laravel/skills/migration
Command: npx skills add https://github.com/AdemKao/ai-cowork --skill laravel-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel migrations are essential for maintaining consistent database schemas across projects, but creating them manually can be error-prone and time-consuming. This skill provides a structured approach to generate migrations with proper columns, indexes, and foreign keys.

Core Features & Use Cases

  • Automated scaffolding for common table structures (primary keys, foreign keys, timestamps, soft deletes).
  • Reversible down methods and safe defaults to preserve data integrity.
  • Use cases include creating new tables, altering existing schemas, and implementing relationships between models.

Quick Start

Create a new Laravel migration for a specified table using the standard template and define columns, indexes, and foreign keys.

Frequently Asked Questions about laravel-migration

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

FAQPage Schema
How do I create a Laravel migration with foreign keys and indexes?

Creating Laravel migrations with foreign keys and indexes involves defining schema columns, relations, and safe defaults. This structured approach generates reversible down methods and automated scaffolding for primary keys and timestamps to maintain data integrity.

What is the best way to structure a reversible Laravel migration?

Structuring a reversible Laravel migration requires defining both up and down methods. This approach safely applies schema updates and reverses them if needed, preserving data integrity across tasks like adding tables or altering existing structures.

Does this migration approach support altering existing database schemas?

Yes, this approach supports altering existing database schemas in Laravel. You can update structures by adding columns, defining indexes, and implementing model relationships while maintaining safe defaults and reversible down methods.

How do Laravel migrations enforce consistent database schemas across projects?

Laravel migrations enforce consistent database schemas by applying structured definitions for columns, indexes, and foreign keys. This automated scaffolding prevents manual errors and ensures uniform table structures including primary keys, timestamps, and soft deletes.

When do I need to define foreign keys in a Laravel database schema?

You need to define foreign keys in a Laravel database schema when designing relations across models. This enforces referential integrity at the database level, ensuring related records remain consistent during structural updates or deletions.