From 482dc1262cd6deff716523264e09ff4256e750a7 Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Sat, 16 Nov 2024 18:43:54 -0500 Subject: [PATCH] Fix tests. --- src/Commands/DomainModelMakeCommand.php | 5 ++++- src/Commands/DomainViewModelMakeCommand.php | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Commands/DomainModelMakeCommand.php b/src/Commands/DomainModelMakeCommand.php index de45c24..9739576 100644 --- a/src/Commands/DomainModelMakeCommand.php +++ b/src/Commands/DomainModelMakeCommand.php @@ -92,7 +92,10 @@ protected function createBaseModelIfNeeded() $domain = DomainResolver::guessDomainFromClass($baseModel); - $name = Str::after($baseModel, $domain); + $name = str($baseModel) + ->after($domain) + ->replace(['\\', '/'], '/') + ->toString(); $this->call(DomainBaseModelMakeCommand::class, [ '--domain' => $domain, diff --git a/src/Commands/DomainViewModelMakeCommand.php b/src/Commands/DomainViewModelMakeCommand.php index c457405..e75700b 100644 --- a/src/Commands/DomainViewModelMakeCommand.php +++ b/src/Commands/DomainViewModelMakeCommand.php @@ -2,7 +2,6 @@ namespace Lunarstorm\LaravelDDD\Commands; -use Illuminate\Support\Str; use Lunarstorm\LaravelDDD\Commands\Concerns\HasDomainStubs; use Lunarstorm\LaravelDDD\Support\DomainResolver; @@ -55,7 +54,10 @@ public function handle() $domain = DomainResolver::guessDomainFromClass($baseViewModel); - $name = Str::after($baseViewModel, $domain); + $name = str($baseViewModel) + ->after($domain) + ->replace(['\\', '/'], '/') + ->toString(); $this->call(DomainBaseViewModelMakeCommand::class, [ '--domain' => $domain,