Skip to content

Commit a6b0541

Browse files
[11.x] Component name guessing with prefix (#53183)
* Component name guessing with prefix * Style * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 94f5888 commit a6b0541

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/View/Compilers/ComponentTagCompiler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ protected function guessAnonymousComponentUsingNamespaces(Factory $viewFactory,
382382
return $view;
383383
}
384384

385-
if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory).'.'.Str::afterLast($componentName, '.'))) {
385+
$lastViewSegment = Str::afterLast(Str::afterLast($componentName, '.'), ':');
386+
387+
if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory).'.'.$lastViewSegment)) {
386388
return $view;
387389
}
388390
});

0 commit comments

Comments
 (0)