Hammerfels 9
Hammerfels 9
FFilament
Created by Hammerfels 9 on 10/14/2024 in #❓┊help
How can I add a property to a page (like the record) that still exists after a livewire update call?
Hello everyone. I have created a resource which is dependent on another model, so that the URL looks like this: “/6/control/1” or '/{group}/control/{record}' I then resolve this group attribute in the mount method (“in a ListRecords”) so that I end up with a model. The problem now is that when I click on an action, for example, a livewire call is returned. Filament then somehow manages to “restore”, unfortunately I have not found where this happens, but I would like this to happen with my group property as well.
2 replies
FFilament
Created by Hammerfels 9 on 1/11/2024 in #❓┊help
Changing the record for the modal of a form/action
I have tried to edit another model in a resource (form) via an action with modal. Can someone tell me how I can change the record for the modal? I have tried the following: 1. override resolveDefaultClosureDependencyForEvaluationByName() method of the action. Did not work 2. I tried $this->mountUsing(fn (Form $form) => $form->model($myRecord)); to overwrite the record in the form object. So the modal opens without error but if you change something in the modal you get an error. (The error [TypeError] that the record has been changed to the wrong one again)
6 replies