-
Notifications
You must be signed in to change notification settings - Fork 0
Livewire child component
tanthammar edited this page Sep 25, 2020
·
2 revisions
You can use a Livewire component as custom view for a field.
-
$component
= String, the path and name (aspath.name
) to a livewire component -
$params
= Optional array with parameters to pass to the child component.
In this example we are using the custom()
method to tell the component that we want to handle this field manually. (see docs for custom field). Another option could be to do emitUp()
(see Livewire docs) in the child component to populate the field in the main form component.
The example is for a fictive Livewire/App/Tags
component with three properties.
Field::make('Tags')
->custom()
->livewireComponent("app.tags",
[
'model' => $this->model,
'tagType' => "event",
'setLocale' => "sv"
]),