How divineninja/lara-clean works
LaraClean is a Laravel package for scaffolding domain-oriented application code. The main workflow starts with an Artisan user running make:domain; that command delegates model, DTO, and migration generation to the package’s other commands. Those commands render package stubs into the application’s domain directories. Users can also invoke each generator separately. The service provider registers the commands and loads migrations from existing domain directories. The README documents these capabilities; the migration-loading relationship is visible in the provider, while generated application files are represented conceptually.
Main entry points: LaraCleanServiceProvider.php Service Provider · MakeDomain.php Domain Generator · MakeDomainModel.php Model Generator · MakeDomainDto.php DTO Generator
Components 12
Laravel Integration
- Service Provider
src/LaraCleanServiceProvider.php
Domain Scaffolding
- Domain Generator
src/Console/Commands/MakeDomain.php - Model Generator
src/Console/Commands/MakeDomainModel.php - DTO Generator
src/Console/Commands/MakeDomainDto.php - Migration Generator
src/Console/Commands/MakeDomainMigration.php - Generated Domain Files
Generation Templates
- Model Template
src/stubs/model.stub - DTO Template
src/stubs/dto.stub - Migration Template
src/stubs/migration.stub
Other components
- Artisan User
- Laravel Migrations
- Laravel Class Generator
Connections 17
- Artisan User → Service Provider: loads package
- Service Provider → Domain Generator: registers commands
src/LaraCleanServiceProvider.php - Service Provider → Model Generator: registers commands
src/LaraCleanServiceProvider.php - Service Provider → DTO Generator: registers commands
src/LaraCleanServiceProvider.php - Service Provider → Migration Generator: registers commands
src/LaraCleanServiceProvider.php - Artisan User → Domain Generator: runs command
Readme.md - Domain Generator → Model Generator: calls generator
src/Console/Commands/MakeDomain.php - Domain Generator → DTO Generator: calls generator
src/Console/Commands/MakeDomain.php - Domain Generator → Migration Generator: calls generator
src/Console/Commands/MakeDomain.php - Domain Generator → Laravel Class Generator: calls make:class
src/Console/Commands/MakeDomain.php - Model Generator → Model Template: reads template
src/Console/Commands/MakeDomainModel.php - DTO Generator → DTO Template: reads template
src/Console/Commands/MakeDomainDto.php - Migration Generator → Migration Template: reads template
src/Console/Commands/MakeDomainMigration.php - Model Generator → Generated Domain Files: writes model
src/Console/Commands/MakeDomainModel.php - DTO Generator → Generated Domain Files: writes DTO
src/Console/Commands/MakeDomainDto.php - Migration Generator → Generated Domain Files: writes migration
src/Console/Commands/MakeDomainMigration.php - Service Provider → Laravel Migrations: loads domain migrations
src/LaraCleanServiceProvider.php