Problem creating Custom Field rendering Livewire

I would like to share the data between custom field livewire and rendered child livewire. I get error Object of class Closure could not be converted to string. Below is my custom field view file . In my child livewire i am using #[Modelable] as per livewire 3 documentation.
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>


<div >

<button type="button" @click="$dispatch('open-modal', { id: 'business-category-select-modal' })">
Select Business Categories
</button>


<x-filament::modal id="business-category-select-modal">
<x-slot name="heading">
Modal heading
</x-slot>

<livewire:business-category-selection :modelId="$modelId" modelType="Brand" :key="'business-category-select-' . $modelId" wire:model="{{ $getStatePath() }}" />
</x-filament::modal>

</div>


</x-dynamic-component>
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>


<div >

<button type="button" @click="$dispatch('open-modal', { id: 'business-category-select-modal' })">
Select Business Categories
</button>


<x-filament::modal id="business-category-select-modal">
<x-slot name="heading">
Modal heading
</x-slot>

<livewire:business-category-selection :modelId="$modelId" modelType="Brand" :key="'business-category-select-' . $modelId" wire:model="{{ $getStatePath() }}" />
</x-filament::modal>

</div>


</x-dynamic-component>
3 Replies
LeandroFerreira
I think you could provide a minimal repo on github to reproduce this issue
Pritbor
PritborOP3w ago
@LeandroFerreira issue is straight forward..... I am trying to create a custom field. But I would like to bind the data used in the Livewire with the field name. wire:model="{{ $getStatePath() }}" used in the livewire rendering is giving the mentioned error. Object of class Closure could not be converted to string.
Solution
Want results from more Discord servers?
Add your server