1. Go to this page and download the library: Download shahmy/laravel-ddd-toolkit 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/ */
shahmy / laravel-ddd-toolkit example snippets
return [
// Root directory for all DDD domains (relative to base_path())
'src_directory' => env('DDD_SRC_DIR', 'src'),
// Base PSR-4 namespace mapped to src_directory
'base_namespace' => 'Src',
// Name of the cross-domain shared bounded context
'shared_domain' => 'Shared',
// Automatically add PSR-4 entry to composer.json after domain creation
'auto_register_namespaces' => true,
// Automatically run composer dump-autoload after namespace registration
'auto_dump_autoload' => true,
// PHP testing framework for generated test stubs
'test_framework' => env('DDD_TEST_FRAMEWORK', 'pest'), // 'pest' or 'phpunit'
// Layer structure created for every new domain
'layers' => [
'Application' => ['Actions', 'Commands', 'DTOs', 'Events', 'Exceptions', 'Interfaces', 'Jobs', 'Listeners', 'Queries', 'Services', 'UseCases'],
'Domain' => ['Entities', 'Enums', 'Events', 'Exceptions', 'Repositories', 'Services', 'Specifications', 'Traits', 'ValueObjects'],
'Infrastructure' => ['Cache', 'Factories', 'Mappers', 'Providers', 'Services'],
'Infrastructure/Persistence' => ['Eloquent', 'Migrations', 'Repositories', 'Seeders'],
'Presentation/API' => ['Controllers', 'Middleware', 'Requests', 'Resources', 'Routes'],
'Presentation/CLI' => [],
'Presentation/WEB' => [],
'Tests' => ['Feature', 'Unit'],
],
];