Back to Skills

laravel-migrations

verified

Create database migrations with schema builder, indexes, foreign keys, and seeders. Use when designing database schema, creating tables, or modifying columns.

View on GitHub

Marketplace

fusengine-plugins

fusengine/agents

Plugin

fuse-laravel

development

Repository

fusengine/agents

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

Last Verified

January 22, 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

## Documentation

### Database
- [database.md](docs/database.md) - Database basics
- [migrations.md](docs/migrations.md) - Migrations
- [seeding.md](docs/seeding.md) - Database seeding
- [queries.md](docs/queries.md) - Query builder
- [mongodb.md](docs/mongodb.md) - MongoDB integration

## Migration Template

```php
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('title');
            $table->string('slug')->unique();
            $table->text('content');
            $table->string('status')->default('draft');
            $table->timestamp('published_at')->nullable();
            $table->timestamps();
            $table->softDeletes();

            $table->index(['status', 'published_at']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('posts');
    }
};
```

## Column Types

```php
$table->string('name', 100);           // VARCHAR(100)
$table->text('description');           // TEXT
$table->integer('count');              // INT
$table->decimal('price', 8, 2);        // DECIMAL(8,2)
$table->boolean('is_active');          // BOOLEAN
$table->json('metadata');              // JSON
$table->timestamps();                  // created_at, updated_at
$table->softDeletes();                 // deleted_at
```

## Foreign Keys

```php
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('author_id')->constrained('users')->nullOnDelete();
```

## Seeder

```php
<?php

declare(strict_types=1);

namespace Database\Seeders;

final class PostSeeder extends Seeder
{
    public function run(): void
    {
        User::factory(

Validation Details

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