PHP code example of faguvenli / laravel-ddd-domain

1. Go to this page and download the library: Download faguvenli/laravel-ddd-domain library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

faguvenli / laravel-ddd-domain example snippets




return [
    /*
    |--------------------------------------------------------------------------
    | Base Paths
    |--------------------------------------------------------------------------
    |
    | These values determine the base paths where the domain and application
    | directories will be created. You can customize these if your Laravel
    | project uses a different structure.
    |
    */
    'paths' => [
        'domain' => 'src/Domain',
        'app' => 'src/app',
    ],

    /*
    |--------------------------------------------------------------------------
    | API Prefix
    |--------------------------------------------------------------------------
    |
    | This value determines the prefix for API controllers and resources.
    | Options might 
bash
php artisan vendor:publish --provider="Laravelddd\Domain\LaravelDddDomainServiceProvider" --tag="config"
bash
php artisan make:ddd-domain {name} [--api-prefix=]

src/
├── Domain/
│   └── Product/
│       ├── Actions/
│       │   ├── ProductCreateAction.php
│       │   └── ProductUpdateAction.php
│       ├── DataTransferObjects/
│       │   └── ProductData.php
│       ├── Exceptions/
│       ├── Models/
│       │   └── Product.php
│       └── QueryBuilders/
│           └── ProductQueryBuilder.php
└── app/
    └── Api/
        └── Product/
            ├── Controllers/
            │   └── ProductController.php
            ├── Factories/
            │   ├── ProductCreateDataFactory.php
            │   └── ProductUpdateDataFactory.php
            ├── Queries/
            │   └── ProductIndexQuery.php
            ├── Requests/
            │   ├── ProductCreateRequest.php
            │   └── ProductUpdateRequest.php
            └── Resources/
                └── ProductResource.php