Skip to content

Commit

Permalink
added method to get view path for row view, which was not correct before
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmKevinMcKee committed Jul 21, 2021
1 parent 8ddb81e commit 48c5d5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Commands/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');
Expand Down

0 comments on commit 48c5d5f

Please sign in to comment.