Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from protonemedia/ComponentNamespaceFix
Browse files Browse the repository at this point in the history
Fix for component namespace
  • Loading branch information
pascalbaljet authored Nov 22, 2023
2 parents 0e125d1 + a317389 commit 4ef637c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ComponentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Str;
use Illuminate\Support\Stringable;
use Illuminate\View\AnonymousComponent;
use Illuminate\View\Compilers\ComponentTagCompiler;
use Illuminate\View\Component;
Expand Down Expand Up @@ -88,7 +89,8 @@ public function getTag(Component|View|string $component): ?string
}

return Str::of($class)
->after('\\View\\Components\\')
->when(fn (Stringable $class) => $class->contains('\\View\\Components\\'), fn (Stringable $class) => $class->after('\\View\\Components\\'))
->when(fn (Stringable $class) => $class->contains('\\Components\\'), fn (Stringable $class) => $class->after('\\Components\\'))
->prepend('SpladeComponent')
->replace('\\', '')
->toString();
Expand Down

0 comments on commit 4ef637c

Please sign in to comment.