lunarstorm/laravel-ddd

[1.x] Fix Base Models

Closed this issue · 0 comments

This applies to the next branch only.

Observed an issue with ddd:view-model:

  • appeared to always try to create a base view model even though one exists
% php artisan ddd:view-model Shared:TestViewModel
Base view model Domain\Shared\ViewModels\ViewModel doesn't exist, generating...

   ERROR  Base View Model already exists.  

   INFO  View Model [src/Domain/Shared/ViewModels/TestViewModel.php] created successfully. 
  • view model stub incompatible with the refactored generator internals. Ends up inserting the import as
use Domain\\Shared\ViewModels\ViewModel;

with the extra slash. Should also create a failing test for this first before patching.