Skip to content

Commit 48c5d5f

Browse files
committed
added method to get view path for row view, which was not correct before
1 parent 8ddb81e commit 48c5d5f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Commands/MakeCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ public function classContents()
122122
}
123123

124124
if($this->viewPath) {
125-
$viewPath = Str::after($this->viewPath, 'resources/views/');
126125
$contents = Str::replaceLast("}\n", "
127126
public function rowView(): string
128127
{
129-
return '" . $viewPath . "';
128+
return '" . $this->getViewPathForRowView() . "';
130129
}
131130
}\n",
132131
$contents);
@@ -135,6 +134,11 @@ public function rowView(): string
135134
return $contents;
136135
}
137136

137+
private function getViewPathForRowView(): string
138+
{
139+
return Str::before(Str::after($this->viewPath, 'resources/views/'), '.blade.php');
140+
}
141+
138142
public function viewContents()
139143
{
140144
return file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'view.stub');

0 commit comments

Comments
 (0)