Download the PHP package laravel-architex/architecture-generator without Composer
On this page you can find all versions of the php package laravel-architex/architecture-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-architex/architecture-generator
More information about laravel-architex/architecture-generator
Files in laravel-architex/architecture-generator
Package architecture-generator
Short Description Laravel Architecture Generator - A powerful tool to generate project structure based on popular architecture patterns
License MIT
Homepage https://github.com/laravel-architex/architecture-generator
Informations about the package architecture-generator
Laravel Architex - Architecture Generator
Laravel Architex is a powerful tool that helps Laravel developers quickly initialize project structure based on popular architecture patterns, automatically generating folders, classes, interfaces, service providers, and necessary files based on templates.
🚀 Key Features
Supported Architectures:
- DDD (Domain Driven Design) - Create 4-layer structure: Domain, Application, Infrastructure, UI
- Repository Pattern - Create interface and implementation for repositories
- Service Layer - Create service classes with basic methods
- CQRS (Command Query Responsibility Segregation) - Create commands, queries and handlers
- Event Bus - Create events and listeners
- Modular/Package-based Architecture - Create complete module structure with controllers, models, services, repositories, routes, config, tests, and more
- Hexagonal Architecture (Ports and Adapters) - Create clean architecture with domain isolation, ports, and adapters
Additional Features:
- ✅ Configurable naming conventions (class names, interfaces, namespaces, folder structure)
- ✅ Integrated Artisan commands for quick component generation
- ✅ Template engine (stub files) for customizing generated code
- ✅ Configuration through
architex.phpfile in config/ - ✅ Auto registration in service providers
📦 Installation
System Requirements:
- PHP >= 7.4
- Laravel >= 8.0
CI/CD Status:
Quick Setup (Recommended)
Manual Installation
For Development/Testing
Setup RepositoryService
Quick Start with RepositoryService:
🛠️ Usage
1. Repository Pattern
Laravel Architex generates a complete repository pattern with clean architecture:
Quick Start
Generated Structure
Key Features
- ✅ BaseRepository Trait: Clean, reusable trait with all common methods
- ✅ Type Safety: Each repository implements its own interface
- ✅ Service Layer: Business logic separated from data access
- ✅ Auto Registration: Service providers automatically registered in config/app.php
- ✅ Dependency Injection: Ready to use with Laravel's DI container
- ✅ PHPDoc Support: IDE-friendly with proper method annotations
BaseRepository Methods
Usage Examples
Usage Examples:
1. Using Repository Pattern with Dependency Injection
2. Using Service Layer
3. Using Repository Directly
4. Auto Registration
Service providers are automatically registered in config/app.php:
5. Complete Repository Methods
6. Benefits
- ✅ Clean Architecture: Separation of concerns with repository and service layers
- ✅ Type Safety: Each repository implements its own interface
- ✅ Reusable: BaseRepository trait provides common functionality
- ✅ Testable: Easy to mock interfaces for testing
- ✅ Auto Registration: No manual configuration needed
- ✅ IDE Support: Full PHPDoc annotations for better development experience
- ✅ Laravel Integration: Works seamlessly with Laravel's DI container $user = Repository::model(User::class)->updateOrCreate( ['email' => '[email protected]'], ['name' => 'John Doe'] );
// Sync Relations Repository::model(User::class)->sync(1, 'roles', [1, 2, 3]); Repository::model(User::class)->syncWithoutDetaching(1, 'roles', [1, 2, 3]); bash
Create service for User
php artisan make:service User
Overwrite existing files
php artisan make:service User --force bash
Create complete DDD module
php artisan make:ddd UserManagement
Create only specific layers
php artisan make:ddd UserManagement --layers=domain,application
Overwrite existing files
php artisan make:ddd UserManagement --force
app/ ├── Domain/ │ └── UserManagement/ │ ├── Entities/ │ ├── Repositories/ │ ├── Services/ │ ├── Events/ │ └── Exceptions/ ├── Application/ │ └── UserManagement/ │ ├── Services/ │ ├── Commands/ │ ├── Queries/ │ └── Handlers/ ├── Infrastructure/ │ └── UserManagement/ │ ├── Repositories/ │ ├── Services/ │ ├── Persistence/ │ └── External/ └── UI/ └── UserManagement/ ├── Controllers/ ├── Requests/ ├── Resources/ └── Middleware/ bash
Create complete CQRS structure
php artisan make:cqrs CreateUser
Create only command
php artisan make:command CreateUser
Create only query
php artisan make:query GetUser
Overwrite existing files
php artisan make:cqrs CreateUser --force bash
Option A: Create both event and listener (recommended)
php artisan architex:event-bus UserCreated
Option B: Use Laravel defaults (create separately)
php artisan make:event UserCreatedEvent php artisan make:listener UserCreatedListener --event="App\Events\UserCreatedEvent" bash
Create complete modular structure
php artisan architex:modular UserManagement
Create with specific options
php artisan architex:modular UserManagement --with-tests --with-migrations --with-seeders --with-routes --with-config
Create with custom path and namespace
php artisan architex:modular UserManagement --path=app/Modules --namespace=App\Modules
Create with all features
php artisan architex:modular UserManagement --with-tests --with-migrations --with-seeders --with-routes --with-config --with-views --with-assets
Overwrite existing files
php artisan architex:modular UserManagement --force
app/Modules/UserManagement/ ├── Controllers/ │ └── UserManagementController.php ├── Models/ │ └── UserManagement.php ├── Services/ │ └── UserManagementService.php ├── Repositories/ │ └── UserManagementRepository.php ├── Providers/ │ └── UserManagementServiceProvider.php ├── Routes/ │ └── web.php ├── Config/ │ └── usermanagement.php ├── Views/ (optional) ├── Assets/ (optional) ├── Database/ │ ├── Migrations/ │ │ └── 2024_01_01_000000_create_user_managements_table.php │ └── Seeders/ │ └── UserManagementSeeder.php ├── Tests/ │ └── UserManagementTest.php └── README.md bash
Create complete hexagonal structure
php artisan architex:hexagonal User
Create with specific options
php artisan architex:hexagonal User --with-tests --with-migrations --with-routes
Create with custom path and namespace
php artisan architex:hexagonal User --path=app/Hexagonal --namespace=App\Hexagonal
Create with all features
php artisan architex:hexagonal User --with-tests --with-migrations --with-routes --with-config
Overwrite existing files
php artisan architex:hexagonal User --force
app/Hexagonal/User/ ├── Domain/ │ ├── Entities/ │ │ └── User.php │ └── Ports/ │ ├── UserRepositoryPort.php │ └── UserServicePort.php ├── Application/ │ └── Services/ │ └── UserApplicationService.php ├── Infrastructure/ │ ├── Adapters/ │ │ └── UserRepositoryAdapter.php │ └── database/migrations/ │ └── create_users_table.php ├── UI/ │ ├── Adapters/ │ │ └── UserControllerAdapter.php │ └── routes/ │ └── user_routes.php ├── Tests/ │ └── UserHexagonalTest.php └── UserServiceProvider.php bash
Publish config file
php artisan vendor:publish --tag=architex-config bash php artisan vendor:publish --tag=architex-config bash
Install dependencies
composer install
Run all tests
./run-tests.sh all
Run with coverage
./run-tests.sh coverage
Run specific tests
./run-tests.sh specific tests/ArchitectureGeneratorTest.php bash
Run all tests
./vendor/bin/phpunit
Run unit tests only
./run-tests.sh unit
Run integration tests only
./run-tests.sh integration
Run tests in watch mode
./run-tests.sh watch
Run with verbose output
./vendor/bin/phpunit --verbose
Run specific test method
./vendor/bin/phpunit --filter test_can_generate_repository
## 📚 Documentation
- **[README.md](README.md)** - Main documentation and usage guide
- **[DEVELOPMENT.md](DEVELOPMENT.md)** - Development setup, testing, and contributing guide
- **[TESTING.md](TESTING.md)** - Detailed testing information
- **[INSTALLATION_GUIDE.md](INSTALLATION_GUIDE.md)** - Step-by-step installation guide
- **[.github/README.md](.github/README.md)** - GitHub Actions workflows guide
## 🆘 Support
If you encounter issues or have questions, please:
- Create an issue on GitHub
- Contact us via email: [email protected]
- Join our Discord community
---
**Laravel Architex** - Help you build Laravel architecture quickly and professionally! 🚀 All versions of architecture-generator with dependencies
laravel/framework Version ^8.0|^9.0|^10.0|^11.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0
illuminate/filesystem Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0