Skip to content
Permalink
Browse files

support either order of arguments for symmetry with livewire

  • Loading branch information
taylorotwell committed Mar 10, 2020
1 parent d2ae7e4 commit 8d5586700ad97b92ac622ea72c1fefe52c359265
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Illuminate/View/Compilers/BladeCompiler.php
@@ -538,6 +538,10 @@ public function check($name, ...$parameters)
*/
public function component($class, $alias = null, $prefix = '')
{
if (! is_null($alias) && Str::contains($alias, '\\')) {
[$class, $alias] = [$alias, $class];
}

if (is_null($alias)) {
$alias = Str::contains($class, '\\View\\Components\\')
? collect(explode('\\', Str::after($class, '\\View\\Components\\')))->map(function ($segment) {

0 comments on commit 8d55867

Please sign in to comment.
You can’t perform that action at this time.