Livewire + Alpine optimisation
I have a component that displays the title of a model, then when you click on the button it switches to a form with one field for the title. This component is intended to be displayed for a collection of models. It does the job but I have some queries.
1. For all the functions that are called as a result of events, the only way I could manage to isolate the component that needs it, is to have a check for
$model_id
which means there is still a request for every component. Is there a better way to do this? I have read the docs.
2. minor issue. I would like the form to be submitted by clicking away from the component (ie. no submit button). The current implementation works with wire:model.lazy="title"
and having the updatedTitle()
listen for it, however I can't call updatedTitle()
in my pest tests. again, I wonder if there is a better way to do this?
I know this isn't entirely filament related, but I am using it for the forms in this example. Thanks!Solution:Jump to solution
1 Reply
Solution