F
Filamentβ€’7mo ago
Phil

Update Form from Action Modal

I have a form with a repeater list. Products with prices can be added there. To make a quick selection, there is an additional button that opens a modal where I can select many products at once. How can I return the selected products to the create form, inside the action() method of the button, so that a repeater entry is created for each product? As the data record has not yet been saved, I cannot use
->action(array $data, MyObj $obj) { $obj->products()->attach(...); })
->action(array $data, MyObj $obj) { $obj->products()->attach(...); })
No description
No description
Solution:
maybe injecting Set $set ?
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’7mo ago
maybe injecting Set $set ?
Phil
PhilOPβ€’7mo ago
Works perfectly. Took me 3 hours πŸ˜„
Want results from more Discord servers?
Add your server