Including a Livewire component inside an Infolist
Hi,
I try to render a small Livewire component inside an Infolist modal.
It renders when using ViewEntry component, but when I call a method from the Livewire component, it fails with the error
Unable to call component method. Public method [confirmLoginLink] not found on componentThe component is supposed to start some background stuff and then update when a model instance is changed. ViewEntry Livewire template I suspect that I'm using the wrong approach here, and would appreciate if someone could point me in the right direction.
4 Replies
Hi @hgrimelid, can you share the complete template (the main component that includes the other component)? I suspect the
wire:click
is not calling the method in the right scope.@Patrick Boivin I reference the Livewire template (the one shown above) directly from the
infolist
method in the resource class. I don't have any other templates.Ok, I'm not sure it's the right approach, but you're not far. I think you need to include a regular Blade view in
->view()
, and then inside of that view, render your Livewire component.@Patrick Boivin That worked! Thank you, appreciated!