From 6716e1927f314b5b8b9b179e4bd26dcedfa98601 Mon Sep 17 00:00:00 2001 From: MrHex Date: Mon, 24 Apr 2023 20:48:59 +0330 Subject: [PATCH] Fix: MakeRelationManager command --- src/Commands/ModuleMakeRelationManagerCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Commands/ModuleMakeRelationManagerCommand.php b/src/Commands/ModuleMakeRelationManagerCommand.php index a6dcf9c..c8f5186 100755 --- a/src/Commands/ModuleMakeRelationManagerCommand.php +++ b/src/Commands/ModuleMakeRelationManagerCommand.php @@ -91,6 +91,8 @@ public function handle(): int $recordTitleAttribute = (string) Str::of($this->argument('recordTitleAttribute') ?? $this->askRequired('Title attribute (e.g. `name`)', 'title attribute')) ->trim(' '); + $resourcePath = $resources_path; + $path = (string) Str::of($managerClass) ->prepend("{$resourcePath}/{$resource}/RelationManagers/") ->replace('\\', '/') @@ -172,7 +174,7 @@ public function handle(): int $this->copyStubToApp('RelationManager', $path, [ 'eloquentQuery' => $this->indentString($eloquentQuery, 1), - 'namespace' => "{$resourceNamespace}\\{$resource}\\RelationManagers", + 'namespace' => "{$resources_namespace}\\{$resource}\\RelationManagers", 'managerClass' => $managerClass, 'recordTitleAttribute' => $recordTitleAttribute, 'relationship' => $relationship,