diff --git a/README.md b/README.md index a67fe39..beb7412 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Some objects interact with the domain layer, but are not part of the domain laye ], ], ``` -The default configuration above will result in the following: +The configuration above will result in the following: ```bash ddd:model Invoicing:Invoice --controller --resource --requests ``` @@ -323,12 +323,17 @@ return [ | Application Layer |-------------------------------------------------------------------------- | - | Configure domain objects in the application layer. + | Configure objects that belong in the application layer. + | + | e.g., App\Modules\Invoicing\Controllers\* + | App\Modules\Invoicing\Requests\* | */ 'application' => [ 'path' => 'app/Modules', 'namespace' => 'App\Modules', + + // Specify which ddd:* objects belong in the application layer 'objects' => [ 'controller', 'request', @@ -338,12 +343,11 @@ return [ /* |-------------------------------------------------------------------------- - | Domain Object Namespaces + | Generator Object Namespaces |-------------------------------------------------------------------------- | - | This value contains the default namespaces of generated domain - | objects relative to the domain namespace of which the object - | belongs to. + | This array maps the default relative namespaces of generated objects + | relative to their domain's root namespace. | | e.g., Domain\Invoicing\Models\* | Domain\Invoicing\Data\* diff --git a/config/ddd.php b/config/ddd.php index 33ee3b0..dfa4eda 100644 --- a/config/ddd.php +++ b/config/ddd.php @@ -27,12 +27,17 @@ | Application Layer |-------------------------------------------------------------------------- | - | Configure domain objects in the application layer. + | Configure objects that belong in the application layer. + | + | e.g., App\Modules\Invoicing\Controllers\* + | App\Modules\Invoicing\Requests\* | */ 'application' => [ 'path' => 'app/Modules', 'namespace' => 'App\Modules', + + // Specify which ddd:* objects belong in the application layer 'objects' => [ 'controller', 'request', @@ -42,12 +47,11 @@ /* |-------------------------------------------------------------------------- - | Domain Object Namespaces + | Generator Object Namespaces |-------------------------------------------------------------------------- | - | This value contains the default namespaces of generated domain - | objects relative to the domain namespace of which the object - | belongs to. + | This array maps the default relative namespaces of generated objects + | relative to their domain's root namespace. | | e.g., Domain\Invoicing\Models\* | Domain\Invoicing\Data\* diff --git a/config/ddd.php.stub b/config/ddd.php.stub index 6c10645..612b1d8 100644 --- a/config/ddd.php.stub +++ b/config/ddd.php.stub @@ -22,6 +22,29 @@ return [ */ 'domain_namespace' => {{domain_namespace}}, + /* + |-------------------------------------------------------------------------- + | Application Layer + |-------------------------------------------------------------------------- + | + | Configure objects that belong in the application layer. + | + | e.g., App\Modules\Invoicing\Controllers\* + | App\Modules\Invoicing\Requests\* + | + */ + 'application' => [ + 'path' => 'app/Modules', + 'namespace' => 'App\Modules', + + // Specify which ddd:* objects belong in the application layer + 'objects' => [ + 'controller', + 'request', + 'middleware', + ], + ], + /* |-------------------------------------------------------------------------- | Domain Object Namespaces @@ -48,6 +71,7 @@ return [ 'class' => '', 'channel' => 'Channels', 'command' => 'Commands', + 'controller' => 'Controllers', 'enum' => 'Enums', 'event' => 'Events', 'exception' => 'Exceptions', @@ -56,13 +80,17 @@ return [ 'job' => 'Jobs', 'listener' => 'Listeners', 'mail' => 'Mail', + 'middleware' => 'Middleware', + 'migration' => 'Database\Migrations', 'notification' => 'Notifications', 'observer' => 'Observers', 'policy' => 'Policies', 'provider' => 'Providers', 'resource' => 'Resources', + 'request' => 'Requests', 'rule' => 'Rules', 'scope' => 'Scopes', + 'seeder' => 'Database\Seeders', 'trait' => '', ], @@ -125,29 +153,11 @@ return [ | */ 'autoload' => [ - /** - * When enabled, any class within the domain layer extending `Illuminate\Support\ServiceProvider` - * will be auto-registered as a service provider - */ 'providers' => true, - - /** - * When enabled, any class within the domain layer extending `Illuminate\Console\Command` - * will be auto-registered as a command when running in console. - */ 'commands' => true, - - /** - * When enabled, the package will register a custom policy discovery callback to resolve policy names - * for domain models, and fallback to Laravel's default for all other cases. - */ 'policies' => true, - - /** - * When enabled, the package will register a custom factory discovery callback to resolve factory names - * for domain models, and fallback to Laravel's default for all other cases. - */ 'factories' => true, + 'migrations' => true, ], /*