PHP code example of ammardaana / laravel-domain-driven-design
1. Go to this page and download the library: Download ammardaana/laravel-domain-driven-design 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/ */
ammardaana / laravel-domain-driven-design example snippets
class GenerateActionCommand extends Command
{
public function __construct(Filesystem $files)
{
parent::__construct();
$this->files = $files;
$this->namespacePostfix = 'Actions';
$this->type = 'Action';
}
}
bash
php artisan make:domain {--name=}
bash
# Generate a Controller class
php artisan make:controller {--domain=} {--name=}
# Generate a Request class
php artisan make:request {--domain=} {--name=}
# Generate a Resource class
php artisan make:resource {--domain=} {--name=}
# Generate a Middleware class
php artisan make:middleware {--domain=} {--name=}
bash
# Generate a Rule class
php artisan make:rule {--domain=} {--name=}
# Generate a Facade class
php artisan make:facade {--domain=} {--name=}
app/
└── Domain/
├── Authentication/
│ ├── Actions/
│ │ └── LoginAction.php
│ ├── Enums/
│ │ └── UserStatusEnum.php
│ └── Http/
│ └── Controllers
│ └── Requests
│ └── Resources
│ └── Models
│ └── Services
|
└── PurchaseFlow/