v1.2.0-beta.3
Pre-release
Pre-release
The final v1.2.0 pre-release, which adds support for custom layers (e.g., Infrastructure), finalizes the config conventions, adds a ddd:config utility command, and more.
To use this version now:
composer require lunarstorm/laravel-ddd:dev-next
Full 1.2.0 Changelog:
Upgrade guide: https://github.com/lunarstorm/laravel-ddd/blob/next/UPGRADING.md
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] Custom Layers by @JasperTey in #76
Full Changelog: v1.2.0-beta.2...v1.2.0-beta.3