From 48c5d5fe82fb2d06672723437abfa4ffc3c11a93 Mon Sep 17 00:00:00 2001 From: iAmKevinMcKee Date: Wed, 21 Jul 2021 16:25:21 -0500 Subject: [PATCH] added method to get view path for row view, which was not correct before --- src/Commands/MakeCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Commands/MakeCommand.php b/src/Commands/MakeCommand.php index 65d04590c..15bf4221d 100644 --- a/src/Commands/MakeCommand.php +++ b/src/Commands/MakeCommand.php @@ -122,11 +122,10 @@ public function classContents() } if($this->viewPath) { - $viewPath = Str::after($this->viewPath, 'resources/views/'); $contents = Str::replaceLast("}\n", " public function rowView(): string { - return '" . $viewPath . "'; + return '" . $this->getViewPathForRowView() . "'; } }\n", $contents); @@ -135,6 +134,11 @@ public function rowView(): string return $contents; } + private function getViewPathForRowView(): string + { + return Str::before(Str::after($this->viewPath, 'resources/views/'), '.blade.php'); + } + public function viewContents() { return file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'view.stub');