Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

laravel-migrations

verified

Laravel 12 database migrations - Schema Builder, columns, indexes, foreign keys, seeders. Use when designing database schema or managing migrations.

View on GitHub

Marketplace

fusengine-plugins

fusengine/agents

Plugin

fuse-laravel

development

Repository

fusengine/agents
3stars

plugins/laravel-expert/skills/laravel-migrations/SKILL.md

Last Verified

February 2, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/fusengine/agents/blob/main/plugins/laravel-expert/skills/laravel-migrations/SKILL.md -a claude-code --skill laravel-migrations

Installation paths:

Claude
.claude/skills/laravel-migrations/
Powered by add-skill CLI

Instructions

# Laravel Migrations

## Agent Workflow (MANDATORY)

Before ANY implementation, launch in parallel:

1. **fuse-ai-pilot:explore-codebase** - Check existing migrations
2. **fuse-ai-pilot:research-expert** - Verify Laravel 12 patterns via Context7
3. **mcp__context7__query-docs** - Check specific Schema Builder features

After implementation, run **fuse-ai-pilot:sniper** for validation.

---

## Overview

| Feature | Description |
|---------|-------------|
| **Schema Builder** | Create, modify, drop tables |
| **Columns** | 50+ column types with modifiers |
| **Indexes** | Primary, unique, fulltext, spatial |
| **Foreign Keys** | Constraints with cascade options |
| **Seeders** | Populate tables with data |

---

## Critical Rules

1. **Always define down()** - Reversible migrations
2. **Use foreignId()->constrained()** - Not raw unsignedBigInteger
3. **Add indexes on foreign keys** - Performance critical
4. **Test rollback before deploy** - Validate down() works
5. **Never modify deployed migrations** - Create new ones

---

## Decision Guide

### Migration Type

```
Need schema change?
├── New table → make:migration create_X_table
├── Add column → make:migration add_X_to_Y_table
├── Modify column → make:migration modify_X_in_Y_table
├── Add index → make:migration add_index_to_Y_table
└── Seed data → make:seeder XSeeder
```

### Column Type Selection

| Use Case | Type | Example |
|----------|------|---------|
| Primary Key | `id()` | Auto-increment BIGINT |
| Foreign Key | `foreignId()->constrained()` | References parent |
| UUID Primary | `uuid()->primary()` | UUIDs |
| Boolean | `boolean()` | is_active |
| Enum | `enum('status', [...])` | order_status |
| JSON | `json()` | preferences |
| Money | `decimal('price', 10, 2)` | 99999999.99 |
| Timestamps | `timestamps()` | created_at, updated_at |
| Soft Delete | `softDeletes()` | deleted_at |

### Foreign Key Cascade

| Scenario | onDelete | Use Case |
|----------|----------|----------|
| Strict integrity | `restrict

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4672 chars