Skip to content

v1.2.0-beta.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@jaspertey jaspertey released this 10 Nov 05:56
· 2 commits to next since this release
3c73e2d

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 of resource_path('stubs/ddd'). In other words, they are now co-located alongside the framework's published stubs, within a ddd 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 application database/migrations path.

Changed

  • ddd:model now internally extends Laravel's native make: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 now ddd:optimize (ddd:cache is still available as an alias).
  • For Laravel 11.27.1+, the framework's optimize and optimize:clear commands will automatically invoke ddd:optimize and ddd: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

Deprecated

  • Domain base models are no longer required by default, and config('ddd.base_model') is now null by default.
  • Removed ddd-specific model stub, now that ddd:model extends laravel's make:model and therefore inherits the native stubs.

What's Changed

Full Changelog: v1.1.3...v1.2.0-beta.2