Accessing Owner form data from Relation Manager create or edit modal.
Hi yall,
As the title says, is there a way to access a field data on the owner form from a relation manager create or edit modal ?
I want to make some validations based on the current owner's form values wich are not yet saved to the database.
6 Replies
Filament
Relation managers - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
That access the owner model. What I need is accessing values on inputs in the owner form. Say I changed some values on the owner form but didn't save them yet and I click create on the relation manager, now I want to get the news values of the parent form for some validation on the relation manager create dialog.
dd($livewire) you should be able to access the form data there.
i dont think you can access the data easily
its on a different livewire component
The whole idea of attaching a relationship before the record is even created seems weird in general. 🤷♂️
On this case is on the Edit Page, so the record is already created. But my users tend to modify values on the main form, then add details on the relation manager and then click save on the main form. So I'm looking for a way to validate the main form data during the create/edit relation manager modal.
What could be a workaround ? Maybe disabling the relation manager actions if the main form is modified but not saved yet ? Is that possible ?