Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
fusengine avatar

Laravel Architecture

  • 121 installs
  • 22 repo stars
  • Updated August 3, 2026
  • fusengine/agents

For development and infrastructure management.

About

laravel-architecture is an AI coding tool that enhances development workflows. Builders use it for infrastructure, integration, and platform development within the catalog ecosystem.

  • laravel-architecture
  • Development

Laravel Architecture by the numbers

  • 121 all-time installs (skills.sh)
  • Ranked #2,818 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/fusengine/agents --skill laravel-architecture

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs121
repo stars22
Last updatedAugust 3, 2026
Repositoryfusengine/agents

What it does

For development and infrastructure management.

Files

SKILL.mdMarkdownGitHub ↗

Laravel Architecture Patterns

Agent Workflow (MANDATORY)

Before ANY implementation, use TeamCreate to spawn 3 agents:

1. fuse-ai-pilot:explore-codebase - Analyze existing architecture 2. fuse-ai-pilot:research-expert - Verify Laravel patterns via Context7 3. mcp__context7__query-docs - Check service container and DI patterns

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

---

Overview

Laravel architecture focuses on clean separation of concerns, dependency injection, and maintainable code organization. This skill covers everything from project structure to production deployment.

When to Use

  • Structuring new Laravel projects
  • Implementing services, repositories, actions
  • Setting up dependency injection
  • Configuring development environments
  • Deploying to production

---

Critical Rules

1. Thin controllers - Delegate business logic to services 2. Interfaces in app/Contracts/ - Never alongside implementations 3. DI over facades - Constructor injection for testability 4. Files < 100 lines - Split larger files per SOLID 5. Environment separation - .env never committed

---

Architecture

app/
├── Actions/              # Single-purpose action classes
├── Contracts/            # Interfaces (DI)
├── DTOs/                 # Data transfer objects
├── Enums/                # PHP 8.1+ enums
├── Events/               # Domain events
├── Http/
│   ├── Controllers/      # Thin controllers
│   ├── Middleware/       # Request filters
│   ├── Requests/         # Form validation
│   └── Resources/        # API transformations
├── Jobs/                 # Queued jobs
├── Listeners/            # Event handlers
├── Models/               # Eloquent models only
├── Policies/             # Authorization
├── Providers/            # Service registration
├── Repositories/         # Data access layer
└── Services/             # Business logic

---

Reference Guide

Core Architecture

ReferenceWhen to Use
container.mdDependency injection, binding, resolution
providers.mdService registration, bootstrapping
facades.mdStatic proxies, real-time facades
contracts.mdInterfaces, loose coupling
structure.mdDirectory organization
lifecycle.mdRequest handling flow

Configuration & Setup

ReferenceWhen to Use
configuration.mdEnvironment, config files
installation.mdNew project setup
upgrade.mdVersion upgrades, breaking changes
releases.mdRelease notes, versioning

Development Environments

ReferenceWhen to Use
sail.mdDocker development
valet.mdmacOS native development
homestead.mdVagrant (legacy)
octane.mdHigh-performance servers

Utilities & Tools

ReferenceWhen to Use
artisan.mdCLI commands, custom commands
helpers.mdGlobal helper functions
filesystem.mdFile storage, S3, local
processes.mdShell command execution
context.mdRequest-scoped data sharing

Advanced Features

ReferenceWhen to Use
pennant.mdFeature flags
mcp.mdModel Context Protocol
concurrency.mdParallel execution

Operations

ReferenceWhen to Use
deployment.mdProduction deployment
envoy.mdSSH task automation
logging.mdLog channels, formatting
errors.mdException handling
packages.mdCreating packages

---

Templates

TemplatePurpose
UserService.php.mdService + repository pattern
AppServiceProvider.php.mdDI bindings, bootstrapping
ArtisanCommand.php.mdCLI commands, signatures, I/O
McpServer.php.mdMCP servers, tools, resources, prompts
PennantFeature.php.mdFeature flags, A/B testing
Envoy.blade.php.mdSSH deployment automation
sail-config.mdDocker Sail configuration
octane-config.mdFrankenPHP, Swoole, RoadRunner

---

Feature Matrix

FeatureReferencePriority
Service Containercontainer.mdHigh
Service Providersproviders.mdHigh
Directory Structurestructure.mdHigh
Configurationconfiguration.mdHigh
Installationinstallation.mdHigh
Octane (Performance)octane.mdHigh
Sail (Docker)sail.mdHigh
Artisan CLIartisan.mdMedium
Deploymentdeployment.mdMedium
Envoy (SSH)envoy.mdMedium
Facadesfacades.mdMedium
Contractscontracts.mdMedium
Valet (macOS)valet.mdMedium
Upgrade Guideupgrade.mdMedium
Logginglogging.mdMedium
Errorserrors.mdMedium
Lifecyclelifecycle.mdMedium
Filesystemfilesystem.mdMedium
Helpershelpers.mdLow
Pennant (Flags)pennant.mdLow
Contextcontext.mdLow
Processesprocesses.mdLow
Concurrencyconcurrency.mdLow
MCPmcp.mdLow
Packagespackages.mdLow
Releasesreleases.mdLow
Homesteadhomestead.mdLow

---

Quick Reference

Service Injection

public function __construct(
    private readonly UserServiceInterface $userService,
) {}

Service Provider Binding

public function register(): void
{
    $this->app->bind(UserServiceInterface::class, UserService::class);
    $this->app->singleton(CacheService::class);
}

Artisan Command

php artisan make:provider CustomServiceProvider
php artisan make:command ProcessOrders

Environment Access

$debug = env('APP_DEBUG', false);
$config = config('app.name');

---

Laravel 13 Notes

Stack mis à jour

  • Symfony 7.4 et 8.0 supportés en parallèle (HttpFoundation, Console, Mailer)
  • PHP 8.3 minimum (8.2 retiré)
  • pda/pheanstalk 8.0+ requis si driver Beanstalk

Cache::touch() API

Nouvelle méthode pour rafraîchir le TTL sans recalculer la valeur.

Cache::touch('user:123', now()->addHour());
Cache::touch(['user:123', 'user:456'], 3600);

Queue::route() pour routing dynamique

Voir [[laravel-queues]] pour le routing déclaratif par job (connexion/queue cible via configuration plutôt que sur chaque job).

new Model() dans boot() → LogicException

Laravel 13 jette une LogicException si vous instanciez un modèle Eloquent dans register() d'un ServiceProvider (container pas prêt). Utiliser boot() ou un listener.

Migration Laravel 13 → 13

SujetAvant (12)Après (13)
PHP minimum8.28.3
PHPUnit1112
Pest34
CSRFVerifyCsrfToken`PreventRequestForgery` (origin-aware)
Cache prefixunderscorehyphens par défaut (configurer CACHE_PREFIX, REDIS_PREFIX, SESSION_COOKIE pour rétro-compat)
Beanstalkpheanstalk 7.xpheanstalk 8.0+
Symfony7.x7.4 / 8.0
Model boottoléré`new Model()` → LogicException
Confignouveau serializable_classes (allowlist hardening)
# Rétro-compat cache prefixes pour upgrade depuis L12
CACHE_PREFIX=laravel_cache_
REDIS_PREFIX=laravel_database_
SESSION_COOKIE=laravel_session
// config/app.php — durcissement deserialize
'serializable_classes' => [
    App\DTO\PaymentDto::class,
    App\DTO\OrderDto::class,
],

Best Practices

DO

  • Utiliser final readonly class pour DTOs et Value Objects (PHP 8.3+)
  • Injecter via constructor promotion + interface (DI inversion)
  • Logger via Context::add() pour propager metadata entre jobs/requêtes
  • Configurer serializable_classes en production
  • Préférer app(Contract::class) sur App::make() (typage strict)

DON'T

  • Instancier des modèles dans register() (→ LogicException L13)
  • Hardcoder des chemins absolus (utiliser base_path(), storage_path())
  • Mélanger Repository et Service (un par responsabilité)
  • Bypasser le container avec new ConcreteClass()
  • Ignorer le bump du préfixe cache lors d'un upgrade depuis L12

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.