Download the PHP package faguvenli/laravel-ddd-domain without Composer
On this page you can find all versions of the php package faguvenli/laravel-ddd-domain. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download faguvenli/laravel-ddd-domain
More information about faguvenli/laravel-ddd-domain
Files in faguvenli/laravel-ddd-domain
Package laravel-ddd-domain
Short Description A Laravel package to create DDD structured domains
License MIT
Informations about the package laravel-ddd-domain
Laravel DDD Domain Generator
A Laravel package to quickly generate DDD (Domain-Driven Design) structured domains. This package works with Laravel 8 and above.
Installation
You can install the package via composer:
The package will automatically register its service provider.
Configuration
You can publish the configuration file with:
This will publish a laravelddd-domain.php file in your config directory with the following content:
You can customize the base paths for your domain and application code as needed. You can also set a default API prefix if you want all your domains to be placed under a specific prefix.
Usage
To create a new DDD domain structure, run:
Replace {name} with the name of your domain (singular form is recommended, but the command will handle pluralization as needed). You can optionally specify an API prefix using the --api-prefix option.
For example:
This will create the following structure (example without API prefix):
If you use an API prefix like --api-prefix=Admin, the application layer will be structured as:
The command also updates your routes/api.php file to include routes for the new domain.
Structure Explanation
This package creates a DDD structure with the following components:
Domain Layer
- Models: Your domain entities
- Actions: Business logic operations (Create, Update, etc.)
- DataTransferObjects: DTOs for passing data between layers
- QueryBuilders: Custom query builders for your models
- Exceptions: Domain-specific exceptions
Application Layer
- Controllers: API controllers
- Requests: Form request validation
- Resources: API resources for response formatting
- Factories: Factories to create DTOs from requests
- Queries: Query objects for filtering and pagination
Requirements
- PHP 8.0 or higher
- Laravel 8.0, 9.0, 10.0, 11.0, or 12.0
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-ddd-domain with dependencies
illuminate/console Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/filesystem Version ^8.0|^9.0|^10.0|^11.0|^12.0