Skip to content

Commit

Permalink
Update readme/config wordings.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Oct 21, 2024
1 parent 6485bcb commit c24ccf7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 30 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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',
Expand All @@ -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\*
Expand Down
14 changes: 9 additions & 5 deletions config/ddd.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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\*
Expand Down
48 changes: 29 additions & 19 deletions config/ddd.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,6 +71,7 @@ return [
'class' => '',
'channel' => 'Channels',
'command' => 'Commands',
'controller' => 'Controllers',
'enum' => 'Enums',
'event' => 'Events',
'exception' => 'Exceptions',
Expand All @@ -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' => '',
],

Expand Down Expand Up @@ -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,
],

/*
Expand Down

0 comments on commit c24ccf7

Please sign in to comment.