Download the PHP package plin-code/laravel-clean-architecture without Composer
On this page you can find all versions of the php package plin-code/laravel-clean-architecture. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plin-code/laravel-clean-architecture
More information about plin-code/laravel-clean-architecture
Files in plin-code/laravel-clean-architecture
Package laravel-clean-architecture
Short Description Laravel package for generating Clean Architecture structure
License MIT
Informations about the package laravel-clean-architecture
๐๏ธ Laravel Clean Architecture Package
A Laravel package to easily implement Clean Architecture in your projects. ๐
โจ Features
- ๐ฏ Domain-Driven Design - Organize your code with DDD principles
- โก Quick Setup - Get started with Clean Architecture in minutes
- ๐งฉ Auto-Generation - Generate complete domains with one command
- ๐๏ธ Layer Separation - Clear separation between Domain, Application, and Infrastructure
- ๐ง Customizable - Flexible configuration to fit your project needs
- ๐งช Test-Ready - Pre-built test templates for immediate testing
- ๐ Well-Documented - Comprehensive documentation and examples
- ๐จ Modern PHP - Built for PHP 8.3+ with latest Laravel features
๐ Requirements
- ๐ PHP 8.3+
- โก Laravel 12.x / 13.x
๐ฆ Installation
โ๏ธ Configuration
Publish the configuration files and stubs:
๐ฏ Usage
๐๏ธ Installing Clean Architecture structure
This command will create:
- ๐ Folder structure for Domain, Application and Infrastructure layers
- ๐งฉ Base classes (BaseModel, BaseAction, BaseService, etc.)
- โ๏ธ Configuration file
- ๐ Documentation
๐ Creating a new domain
This command will generate:
- ๐๏ธ Domain model with events
- ๐ Status enums
- ๐ Domain events (Created, Updated, Deleted)
- โก Actions (Create, Update, Delete, GetById)
- ๐ง Service
- ๐ API Controller
- ๐ Form Requests (Create, Update)
- ๐ค API Resource
- ๐๏ธ Database migration
- ๐งช Feature tests
After generating the core files, make-domain prompts interactively for optional components. You can choose to also generate an Observer, Listener, Job, Mail, Notification, and Export for the domain. Each prompt can be answered independently, so you only generate what your domain needs.
โ Architecture validation
This command checks your codebase for layer dependency violations (for example, Domain code importing from Infrastructure). It returns exit code 1 when violations are found, making it suitable for use in CI pipelines.
๐ ๏ธ Available commands
clean-arch:install- ๐๏ธ Install Clean Architecture structureclean-arch:make-domain {name}- ๐ Create a complete new domainclean-arch:make-action {name} {domain}- โก Create a new actionclean-arch:make-service {name}- ๐ง Create a new serviceclean-arch:make-controller {name}- ๐ Create a new controllerclean-arch:make-observer {name} {domain}- ๐๏ธ Create a new observerclean-arch:make-listener {name}- ๐ Create a new listenerclean-arch:make-job {name}- โณ Create a new jobclean-arch:make-mail {name}- ๐ง Create a new mailableclean-arch:make-notification {name}- ๐ Create a new notificationclean-arch:make-export {name}- ๐ค Create a new exportclean-arch:validate- โ Validate architecture dependency rulesclean-arch:generate-package {name} {vendor}- ๐ฆ Generate a new package
๐ Project structure after clean-arch:install
๐ Generated structure after clean-arch:make-domain User
๐๏ธ Clean Architecture Principles
This package implements Clean Architecture principles:
- ๐ฏ Domain Layer: Contains business logic and entities
- โก Application Layer: Contains use cases and application logic
- ๐๏ธ Infrastructure Layer: Contains implementation details (controllers, database, etc.)
๐ Dependencies
- ๐ฏ Domain Layer: Does not depend on any other layer
- โก Application Layer: Depends only on Domain Layer
- ๐๏ธ Infrastructure Layer: Depends on Application and Domain Layers
๐ก Examples
๐๏ธ Creating a Product domain
๐ฎ Using in controller
โ๏ธ Configuration
The configuration file config/clean-architecture.php allows you to customize:
- ๐ท๏ธ Default namespace
- ๐ Directory paths
- โ Validation options
- ๐ Logging settings
๐ ๏ธ Development
This package uses several tools to maintain code quality:
๐ง Code Quality Tools
- ๐จ Laravel Pint - Code formatting and style fixing
- ๐ PHPStan - Static analysis for finding bugs
- ๐งช PEST - Modern testing framework built on PHPUnit
- ๐ญ Orchestra Testbench - Laravel package testing
๐ Available Scripts
๐ Development Setup
- ๐ฅ Clone the repository
- ๐ฆ Install dependencies:
composer install - โจ Run quality checks:
composer quality
๐ค Contributing
Pull requests are welcome! ๐ For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate and follow our Contributing Guidelines. ๐
๐ License
MIT ๐
All versions of laravel-clean-architecture with dependencies
illuminate/console Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/filesystem Version ^12.0 || ^13.0