Creating custom livewire action Componente using relationships
Hey guys.
I'm trying to create a Livewire component that will return an Action where I'm using to fill a multi-select with tag options.
It works perfectly when I'm using this action directly on my resource, using headerFunction from View page, but using a custom livewire component doesn't work. Taking a look I imagine that is something related with relationships.
Blade:
<livewire:manage-tag-action :model="$client"/>
Component:
Solution:Jump to solution
You need to provide your model to the action. Probably
->record(fn ($livewire) => $livewire->model)
or similar...4 Replies
Continuing...
It doesn't return an error. It just doesn't fill the MultiSelect field (It works when not using livewire component).
If I try to create a new register, it returns Call to a member function isRelation() on null
I imagine that is something about relationships, could anyone help me please ? I'm losing hairs rsrsrs
In resume.
I need to use relationship in Action using Livewire component.
up
Solution
You need to provide your model to the action. Probably
->record(fn ($livewire) => $livewire->model)
or similarFor filling:
♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️ ♥️
It works guy !!!!
Really thank you !!!!