/fuse-laravel:laravel-migrationsfrom fuse-laravel
Covers Laravel 13 database migrations: Schema Builder API for creating/modifying/dropping tables, 50+ column types, indexes, foreign keys, seeders, Artisan commands, testing, and production rollout.
Ships in fuse-laravel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
| 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 |
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
| 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 |
| Scenario | onDelete | Use Case |
|---|---|---|
| Strict integrity | restrictOnDelete() | Financial records |
| Auto-cleanup | cascadeOnDelete() | Post → Comments |
| Preserve with null | nullOnDelete() | Optional relations |
| No action | noActionOnDelete() | Audit logs |
| Topic | Reference | When to Consult |
|---|---|---|
| Schema | schema.md | Table operations |
| Columns | columns.md | Column types |
| Indexes | indexes.md | Performance indexes |
| Foreign Keys | foreign-keys.md | Constraints |
| Commands | commands.md | Artisan commands |
| Seeding | seeding.md | Populate data |
| Topic | Reference | When to Consult |
|---|---|---|
| Testing | testing.md | Test migrations |
| Production | production.md | Deploy safely |
| Troubleshooting | troubleshooting.md | Fix errors |
| Template | When to Use |
|---|---|
| CreateTableMigration.php.md | New table |
| ModifyTableMigration.php.md | Alter table |
| PivotTableMigration.php.md | Many-to-many |
| Seeder.php.md | Seed patterns |
| MigrationTest.php.md | Test migrations |
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->string('title');
$table->text('content');
$table->enum('status', ['draft', 'published'])->default('draft');
$table->timestamps();
$table->softDeletes();
$table->index(['user_id', 'status']);
});
Schema::table('posts', function (Blueprint $table) {
$table->string('slug')->after('title')->unique();
$table->boolean('featured')->default(false);
});
php artisan make:migration create_posts_table
php artisan migrate
php artisan migrate:rollback --step=1
php artisan migrate:fresh --seed
foreignId()->constrained() for foreign keys--pretend to preview SQLLaravel 13 exposes a helper to enable the pgvector extension on PostgreSQL from a migration. Useful for embeddings and semantic search.
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::ensureVectorExtensionExists();
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->text('content');
$table->vector('embedding', dimensions: 1536)->index(); // OpenAI text-embedding-3-small; HNSW cosine vector index
$table->timestamps();
// equivalent: $table->vectorIndex('embedding'); — removal: dropVectorIndex() (13.30+)
});
}
};
vector columns/indexes also work on MariaDB 11.7+ (no extension needed). See [[laravel-vector-search]] for whereVectorSimilarTo() queries.
$table->foreignUuidFor(User::class) (13.9+) and foreignUlidFor() (13.25+)$table->string('email')->unique()->online(); (PostgreSQL / SQL Server)->inplace() (13.33+, MySQL) on an index or foreign key for the INPLACE DDL algorithmreferences/columns.md (opens in a new tab)references/commands.md (opens in a new tab)references/foreign-keys.md (opens in a new tab)references/indexes.md (opens in a new tab)references/production.md (opens in a new tab)references/schema.md (opens in a new tab)references/seeding.md (opens in a new tab)references/templates/CreateTableMigration.php.md (opens in a new tab)references/templates/MigrationTest.php.md (opens in a new tab)references/templates/ModifyTableMigration.php.md (opens in a new tab)references/templates/PivotTableMigration.php.md (opens in a new tab)references/templates/Seeder.php.md (opens in a new tab)references/testing.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Laravel, PHP, PostgreSQL, MySQL, SQLite
23 skills in this plugin
/fusecoreUse when creating modules, understanding FuseCore structure, or implementing features in a FuseCore modular-monolith Laravel project./laravel-ai-sdkUse when integrating AI agents, tool calling, embeddings, structured output, or streaming in Laravel 13 via the `laravel/ai` package./laravel-apiUse when creating API endpoints, transforming responses with API Resources, or handling API authentication, rate limiting, or versioning./laravel-architectureUse when structuring a Laravel project, creating services/repositories/actions, implementing dependency injection, or organizing code layers./laravel-attributesUse when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes./laravel-authUse when implementing user authentication, API tokens, social login, or authorization in Laravel 13.npx claudepluginhub fusengine/claude-plugins --plugin fuse-laravelOther plugins' skills for the same job