v1.2.0-beta.2
Pre-release
Pre-release
A second v1.2.0 pre-release, which refactors the customization of stubs and introduces a more user friendly ddd:stub
command to publish one or more stubs selectively. To use this version now:
composer require lunarstorm/laravel-ddd:dev-next
Full summary of changes from v1.1.x below.
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 addd
subfolder. - Normalize published stubs to use
.stub
extension instead of.php.stub
(following Laravel's convention).
Added
- Ability to configure the Application Layer, to generate domain objects that don't typically belong inside the domain layer.
// In config/ddd.php 'application' => [ 'path' => 'app/Modules', 'namespace' => 'App\Modules', 'objects' => [ 'controller', 'request', 'middleware', ], ],
- Added
ddd:controller
to generate domain-specific controllers in the application layer. - Added
ddd:request
to generate domain-spefic requests in the application layer. - Added
ddd:middleware
to generate domain-specific middleware in the application layer. - Added
ddd:migration
to generate domain migrations. - Added
ddd:seeder
to generate domain seeders. - Added
ddd:publish
to publish the config or stubs in a more user friendly manner. - Added
ddd:stub
to list, search, and publish one or more stubs as needed. - Migration folders across domains will be registered and scanned when running
php artisan migrate
, in addition to the standard applicationdatabase/migrations
path.
Changed
ddd:model
now internally 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).- For Laravel 11.27.1+, the framework's
optimize
andoptimize:clear
commands will automatically invokeddd:optimize
andddd:clear
respectively. - Normalize stubs to use
.stub
extension instead of.php.stub
(following Laravel's convention). - For ddd:* generators that inherit Laravel's stubs, custom stubs will be resolved as follows:
- Try
stubs/ddd/*.stub
(allows customizing stub for ddd only) - Try
stubs/*.stub
(shared by both make:* and ddd:*) - Fallback to the framework or package default
- Try
Deprecated
- Domain base models are no longer required by default, and
config('ddd.base_model')
is nownull
by default. - Removed ddd-specific model stub, now that
ddd:model
extends laravel'smake:model
and therefore inherits the native stubs.
What's Changed
- [1.2] ddd:model options, migrations, application layer by @jaspertey in #69
- [1.2] Refactoring stubs by @jaspertey in #71
Full Changelog: v1.1.3...v1.2.0-beta.2