laravel-clean-arch

Implement Clean Architecture layers in Laravel applications.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/HubDigitalEPN/HubDigital --skill laravel-clean-arch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-clean-arch
Source: https://github.com/HubDigitalEPN/HubDigital/tree/main/.ai/skills/laravel-clean-arch
Command: npx skills add https://github.com/HubDigitalEPN/HubDigital --skill laravel-clean-arch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill guides users in implementing Clean Architecture within Laravel applications, addressing complex issues of software maintenance and scalability.

Core Features & Use Cases

  • Clean Architecture Principles: Integrates Uncle Bob's Clean Architecture with Laravel's features like Eloquent, Service Container, Queues, Events, and API Resources.
  • Layered Approach: Implements Domain, Application, Infrastructure, and Presentation layers for a modular and testable codebase.
  • Use Case: When users want to refactor a Laravel application towards a maintainable structure, structure a Laravel project properly, or apply DDD principles in Laravel.

Quick Start

Trigger this skill to learn about Clean Architecture in Laravel and see how to refactor a Laravel application toward a maintainable, testable structure.

Frequently Asked Questions about laravel-clean-arch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Laravel application using Clean Architecture and DDD principles?

Structuring a Laravel app with Clean Architecture involves separating code into Domain, Application, Infrastructure, and Presentation layers. This isolates business logic from Eloquent and framework dependencies, creating a modular, testable, and maintainable codebase.

What is the best way to refactor a legacy Laravel app toward a maintainable structure?

Refactoring a legacy Laravel app toward a maintainable structure requires applying SOLID principles to decouple business logic from the framework. This involves migrating code into Domain and Application layers, ensuring your core logic remains framework-agnostic and highly testable.

How does Clean Architecture integrate with Laravel features like Eloquent and Service Container?

Clean Architecture integrates with Laravel features by confining Eloquent, Service Container, Queues, Events, and API Resources to the Infrastructure and Presentation layers. This keeps the Domain and Application layers framework-agnostic while still leveraging Laravel's built-in utilities.

Do I need to know SOLID principles to apply Clean Architecture in Laravel?

Yes, you need a solid understanding of SOLID principles and framework-agnostic design to apply Clean Architecture in Laravel. This foundational knowledge is required to correctly decouple dependencies, structure layers properly, and build scalable PHP APIs.

How do I build scalable APIs in Laravel using Onion or Hexagonal Architecture?

Building scalable APIs in Laravel with Onion or Hexagonal Architecture involves wrapping your core Domain logic in Application use cases, independent of Infrastructure. This dependency inversion allows your API endpoints to remain modular and easily testable as the system scales.