PHP code example of ahmedsaed / laravel-ddd

1. Go to this page and download the library: Download ahmedsaed/laravel-ddd 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/ */

    

ahmedsaed / laravel-ddd example snippets

bash
composer ddd:install
php artisan ddd:make-context Order
bash
php artisan vendor:publish --tag=ddd-config
bash
php artisan ddd:check
php artisan ddd:migrate --pretend
php artisan ddd:migrate
php artisan ddd:seed Order
text
contexts/Order/
├── Config/config.php
├── Providers/OrderServiceProvider.php
├── Domain/
│   ├── Aggregates/
│   ├── Entities/
│   ├── Events/
│   ├── Repositories/
│   └── ValueObjects/
├── Application/{Contracts,DTOs,Queries,UseCases}/
├── Infrastructure/
│   ├── {Integrations,Jobs,Listeners,Mail,Search}/
│   └── Persistence/Eloquent/{Factories,Migrations,Models,Seeders}/
├── Presentation/
│   ├── Console/Commands/
│   └── Http/{Controllers,Middleware,Requests,Resources,Routes}/
├── resources/{assets,views}/
└── tests/{Feature,Unit}/
bash
php artisan ddd:make-listener Order:SendOrderConfirmation \
    --event=Order:OrderPlaced --queued
bash
php artisan ddd:cache
php artisan config:cache