Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit ca6bcd2

Browse files
committed
Allow for dynamic component names
1 parent 580f26d commit ca6bcd2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Tags/Livewire.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ public function wildcard($expression): string
1515
{
1616
return \Livewire\Livewire::mount($expression, $this->params->except('key')->toArray(), $this->params->only('key')->first());
1717
}
18+
19+
/**
20+
* This will load your Livewire component in the Antlers view
21+
*
22+
* {{ livewire:component name="my-component" }}
23+
*/
24+
public function component(): string
25+
{
26+
return $this->wildcard($this->params->pull('name'));
27+
}
1828

1929
/**
2030
* Sharing State Between Livewire And Alpine via entangle.

0 commit comments

Comments
 (0)