How to add only edit form to a livewire component.
Hey there!
I'm trying to build filament form inside livewire component but I want only edit form, when user click on edit action it should open edit form with data prefilled.
I've tried installing it from documentation, but somehow its not working.
Right now on click of edit button it's not opening any model, also the form field 'Reason' and submit button showing like attaching in screenshot.
Is there anything I'm doing wrong.
blade component code.
Thanks!
10 Replies
@Dan Harrin ?
#✅┊rules
im gonna answer just because im here already, but please dont @ me again
you dont need to define or render the form
you just pass the ->form() schema array to the EditAction
and we will do the rest
actions like this do not require any other setup
sorry for the tag.
so you mean i have to remove this method
and i have to do something like this?
yes
you dont need mount() or anything
alright! but sir how to load relationship inside this?
i mean Im trying to do like this (event.location):
and its not working.
I have relation like Event has Many Slots
Im querying like this.
You need a repeater / array field to load in relationships
or simialar
not if its a singular relationship
are you trying to edit the name of the event, or are you trying to select a new event from a list
Im trying to edit the name of event . Its textInput.
Solution
Its working! grateful for your time.