🔥 1.2 is a major update with several new features and breaking changes (for some). Use php artisan ddd:config update
to rebuild your existing config file according to the latest version, and be sure to review the Upgrade Guide for full details about upgrading from 1.1.x.
[1.2.0] - 2024-11-23
Breaking
- Stubs are now published to
base_path('stubs/ddd')
instead ofresource_path('stubs/ddd')
. In other words, they are now co-located alongside the framework's published stubs, within a ddd subfolder. - Published stubs now use
.stub
extension instead of.php.stub
(following Laravel's convention). - If you are using published stubs from pre 1.2, you will need to refactor your stubs accordingly.
Added
- Support for the Application Layer, to generate domain-specific objects that don't belong directly in the domain layer:
// In config/ddd.php 'application_path' => 'app/Modules', 'application_namespace' => 'App\Modules', 'application_objects' => [ 'controller', 'request', 'middleware', ],
- Support for Custom Layers, additional top-level namespaces of your choosing, such as
Infrastructure
,Integrations
, etc.:// In config/ddd.php 'layers' => [ 'Infrastructure' => 'src/Infrastructure', ],
- Added config utility command
ddd:config
to help manage the package's configuration over time. - Added stub utility command
ddd:stub
to publish one or more stubs selectively. - Added
ddd:controller
to generate domain-specific controllers. - Added
ddd:request
to generate domain-spefic requests. - Added
ddd:middleware
to generate domain-specific middleware. - Added
ddd:migration
to generate domain migrations. - Added
ddd:seeder
to generate domain seeders. - Added
ddd:stub
to manage stubs. - Migration folders across domains will be registered and scanned when running
php artisan migrate
, in addition to the standard applicationdatabase/migrations
path. - Ability to customize generator object naming conventions with your own logic using
DDD::resolveObjectSchemaUsing()
.
Changed
ddd:model
now extends Laravel's nativemake:model
and inherits all standard options:--migration|-m
--factory|-f
--seed|-s
--controller --resource --requests|-crR
--policy
-mfsc
--all|-a
--pivot|-p
ddd:cache
is nowddd:optimize
(ddd:cache
is still available as an alias).- Since Laravel 11.27.1, the framework's
optimize
andoptimize:clear
commands will automatically invokeddd:optimize
(ddd:cache
) andddd:clear
respectively.
Deprecated
- Domain base models are no longer required by default, and
config('ddd.base_model')
is nownull
by default. - Stubs are no longer published via
php artisan vendor:publish --tag="ddd-stubs"
. Instead, usephp artisan ddd:stub
to manage them.
What's Changed
- [1.2] Official Release by @JasperTey in #77
- Release 1.2 by @JasperTey in #81
Full Changelog: v1.1.3...v1.2.0