New advertisers: 50% off your first month with code FIRSTMONTHSee slots
fusengine avatar

fuse-laravel

Expert Laravel 13 and PHP 8.3+ guidance covering 22 skills, from architecture to native vector search.

version
1.2.15
GitHub stars
36

What it does

  • Adds the laravel-expert agent and 21 domain skills, including laravel-eloquent, laravel-api, laravel-livewire, laravel-queues, and laravel-testing
  • Covers Attributes-first model, job, and controller patterns, plus JSON:API resources, Laravel AI SDK integration, and pgvector search
  • Enforces PHP 8.3+ strict types, typed constants, and #[\Override] in generated code, following SOLID principles
  • Designed for Laravel teams building APIs and modular monoliths who want Claude to follow official 13.x conventions

Expert Laravel 13 + PHP 8.3+ with SOLID principles, first-class PHP Attributes, Laravel AI SDK, JSON:API Resources, native vector search (pgvector), Eloquent, Livewire, queues with routing, and comprehensive documentation

Add marketplace

/plugin marketplace add fusengine/agents

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install fuse-laravel@fusengine-plugins

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source
FuseCore is a modular-monolith architecture for Laravel 13 with React 19 integration, built on auto-discovery (module.json), SOLID principles, and per-module isolation (models, migrations, routes, React resources, i18n). Covers creating new modules, understanding the FuseCore directory structure and module-discovery mechanism, and implementing features inside FuseCore projects — module contracts, traits (HasModule), service providers, and cross-module dependency declaration.

FuseCore Modular Architecture

Agent Workflow (MANDATORY)

Before ANY implementation in FuseCore project, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze existing modules in /FuseCore/
  2. fuse-ai-pilot:research-expert - Verify Laravel 13 patterns via Context7
  3. fuse-laravel:laravel-expert - Apply Laravel best practices

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


Overview

FuseCore is a Modular Monolith architecture for Laravel 13 with React 19 integration.

ComponentPurpose
ModuleSelf-contained feature (User, Dashboard, Blog)
Auto-DiscoveryAutomatic registration via module.json
TraitsHasModule for resource loading
ContractsModuleInterface, ReactModuleInterface
React IntegrationIsolated React per module
i18nMulti-language support (FR/EN/DE/IT/ES)

Critical Rules

  1. All code in /FuseCore/{Module}/ - Never in /app/
  2. One module.json per module - Required for discovery
  3. ServiceProvider per module - Use HasModule trait
  4. Files within FUSE_SOLID_MAX_LINES - Split larger files (SOLID)
  5. Interfaces in /App/Contracts/ - Never in components
  6. Migrations in module - /Database/Migrations/
  7. Routes in module - /Routes/api.php

Architecture Overview

FuseCore/
├── Core/                    # Infrastructure (priority 0)
│   ├── App/
│   │   ├── Contracts/       # ModuleInterface, ReactModuleInterface
│   │   ├── Services/        # ModuleDiscovery, RouteAggregator
│   │   ├── Traits/          # HasModule, HasModuleDatabase
│   │   └── Providers/       # FuseCoreServiceProvider
│   ├── Config/fusecore.php
│   └── module.json
│
├── User/                    # Auth module
│   ├── App/Models/          # User.php, Profile.php
│   ├── Config/              # Module config (sanctum.php, etc.)
│   ├── Database/Migrations/
│   ├── Resources/React/     # Isolated React
│   ├── Routes/api.php
│   └── module.json          # dependencies: []
│
└── {YourModule}/            # Your new module
    ├── App/
    │   ├── Models/
    │   ├── Http/Controllers/
    │   ├── Services/
    │   └── Providers/{YourModule}ServiceProvider.php
    ├── Config/              # Module-specific config
    ├── Database/Migrations/
    ├── Resources/React/
    ├── Routes/api.php
    └── module.json          # dependencies: ["User"]

Reference Guide

Architecture

TopicReferenceWhen to consult
Overviewarchitecture.mdUnderstanding FuseCore design
Module Structuremodule-structure.mdDirectory organization
Auto-Discoverymodule-discovery.mdHow modules are loaded
module.jsonmodule-json.mdModule configuration

Implementation

TopicReferenceWhen to consult
Contractscontracts.mdModuleInterface, ReactModuleInterface
Traitstraits.mdHasModule, HasModuleDatabase
ServiceProviderservice-provider.mdModule registration
Routesroutes.mdAPI routing

Resources

TopicReferenceWhen to consult
React Integrationreact-integration.mdFrontend per module
Migrationsmigrations.mdDatabase per module
i18ni18n.mdMulti-language setup

Guides

TopicReferenceWhen to consult
Creating Modulecreating-module.mdStep-by-step guide

Templates (Code Examples)

TemplatePurpose
module.json.mdModule configuration
ServiceProvider.php.mdModule service provider
Controller.php.mdAPI controller
Model.php.mdEloquent model
Migration.php.mdDatabase migration
ReactStructure.mdReact module structure
ApiRoutes.php.mdAPI routes file
Resource.php.mdAPI Resource
Request.php.mdForm Request
Service.php.mdBusiness logic service

Quick Reference

Create New Module

# 1. Create directory structure
mkdir -p FuseCore/{ModuleName}/{App/{Models,Http/Controllers,Services,Providers},Database/Migrations,Resources/React,Routes}

# 2. Create module.json
# 3. Create ServiceProvider with HasModule trait
# 4. Create routes/api.php
# 5. Run: php artisan fusecore:cache-clear

module.json

{
    "name": "ModuleName",
    "version": "1.0.0",
    "enabled": true,
    "isCore": false,
    "dependencies": ["User"]
}

ServiceProvider

class ModuleNameServiceProvider extends ServiceProvider
{
    use HasModule;

    public function boot(): void
    {
        $this->loadModuleMigrations();
    }
}

Routes

Route::middleware(['api', 'auth:sanctum'])->group(function () {
    Route::apiResource('items', ItemController::class);
});

Module Checklist

  • /FuseCore/{Module}/ directory created
  • module.json with name, version, dependencies
  • {Module}ServiceProvider.php with HasModule trait
  • Routes in /Routes/api.php
  • Migrations in /Database/Migrations/
  • Models in /App/Models/
  • Controllers in /App/Http/Controllers/
  • React in /Resources/React/ (if needed)
  • i18n in /Resources/React/i18n/locales/

SOLID Compliance

RuleFuseCore Implementation
Single ResponsibilityOne module = one feature
Open/ClosedExtend via ModuleInterface
Liskov SubstitutionReactModuleInterface extends ModuleInterface
Interface SegregationSeparate contracts
Dependency InversionInject via ServiceProvider

File limits: All files within FUSE_SOLID_MAX_LINES. Split well before it.


Naming Conventions

TypeConventionExample
Module folderPascalCaseBlogPost
module.json namePascalCase"name": "BlogPost"
ServiceProvider{Module}ServiceProviderBlogPostServiceProvider
Controller{Resource}ControllerPostController
ModelSingularPost
Migrationcreate_{table}_tablecreate_posts_table
Routes fileapi.phpAlways api.php

Laravel 13 Notes

Stack FuseCore L13

  • Laravel 13 (stable 13.40) + PHP 8.3 minimum
  • React 19 + TypeScript 7 (module frontend side) — TS 7.0 has no compiler API: typescript-eslint (peer typescript <6.1.0) requires the alias "typescript": "npm:@typescript/typescript6@^6.0.2" + "@typescript/native": "npm:typescript@^7.0.2" (npx tsc = 7.0)
  • Inertia 3 (inertiajs/inertia-laravel ^3.0) for the React ↔ modules bridge

Module ServiceProvider and L13

Bindings in register(), observers/hooks in boot(). L13 reminder: instantiating a model during its own boot (new static() inside the model's boot() or a trait's boot*()) throws a LogicException.

public function register(): void
{
    $this->app->bind(PostRepositoryContract::class, EloquentPostRepository::class);
}

public function boot(): void
{
    Post::observe(PostObserver::class);
}

Per-module cache prefixes

L13 uses hyphens by default. For FuseCore, configuring the prefix per module via module.json remains compatible:

{
  "name": "BlogPost",
  "cache_prefix": "blogpost-"
}

Best Practices

DO

  • One module = one complete FuseCore/<Module>/ folder (Contracts/, Services/, Http/, Models/)
  • Declare every inter-module dependency via Contracts (never concrete classes)
  • Use final readonly class for module DTOs (PHP 8.3+)
  • Move all Model logic from register() to boot()
  • Prefer Inertia 3 + React 19 for modules with a UI

DON'T

  • Import a class from another module without going through its Contract
  • Put business logic in Controllers (extract it into a module Service)
  • Instantiate a model during its own boot (new static() inside boot() → LogicException in L13)
  • Exceed the hook ceiling FUSE_SOLID_MAX_LINES per file (split into sub-modules or Services)
  • Share migrations between modules (each module owns its tables)

Readme

Laravel Expert Plugin

Expert Laravel 13 development plugin for Claude Code with comprehensive documentation and best practices.

Features

  • 22 specialized skills covering all Laravel 13 domains (Attributes, AI SDK, JSON:API, vector search, Eloquent, queues, auth, billing, etc.)
  • Documentation based on official Laravel 13.x docs
  • PHP Attributes-first patterns with legacy property migration guides
  • PHP 8.3+ with strict types, typed constants, #[\Override]

Skills

SkillDescription
laravel-architectureServices, repositories, actions, clean code patterns
laravel-eloquentORM, relationships, scopes, casts, query optimization
laravel-apiRESTful APIs, resources, rate limiting, versioning
laravel-authSanctum, Passport, policies, gates, social login
laravel-testingPest, PHPUnit, feature tests, factories, mocking
laravel-queuesJobs, workers, batches, chains, failure handling
laravel-livewireLivewire 4, Volt, reactive components
laravel-bladeTemplates, components, slots, layouts, directives
laravel-migrationsSchema builder, indexes, foreign keys, seeders
laravel-billingStripe Cashier, Paddle, subscriptions, invoices

Usage

# Install the plugin
claude plugins add fusengine-plugins/laravel-expert

# Use the agent
claude --agent laravel-expert "Create a new API endpoint for users"

Trigger Keywords

The agent activates automatically when you mention:

  • Laravel, Eloquent, Blade, Livewire
  • API development, authentication, authorization
  • Database migrations, queues, testing
  • PHP artisan commands

Requirements

  • Laravel 13.x
  • PHP 8.3+
  • Composer

License

MIT

Details

Marketplace
fusengine/agents
Source
plugins/laravel-expert
Author
Fusengine
Category
Development
License
MIT
Keywords
laravel, laravel-13, php, php-8.3, eloquent, livewire, blade, solid, attributes, ai-sdk, jsonapi, vector-search, pgvector
Listed since
Apr 7, 2026

More from fusengine/agents

All 26

Similar to fuse-laravel

More Backend & APIs