hitech95
hitech95
FFilament
Created by hitech95 on 9/13/2024 in #❓┊help
Reload Page on table row action success
Hi, I have a EditPage for a resource that is showing a detail of the resource. In this page I have a Form (FormBuilder). Two of the fields are Livewire::make() components. Such components are two Tables (Created via the TableBuilder). On such tables I can "move" the rows between the two tables. To do so I have an action that updates the Team players. The action trigger the update of the table the action is triggered from, but the other table is not updated. The only way to have the updated data is to manually refresh the page. For example: Resource: Game Table 1: Team Red Players Table 2: Team Blue Players (Both table are the same Livewire Component, a TeamID is passed as a Livewire argument for the query builder of the table) I've been struggling with this issue for some time and any input would be welcome.
23 replies
FFilament
Created by hitech95 on 7/19/2024 in #❓┊help
When saving/edit a resource create a new Model instance instead of update?
Hi, I have the requirement to create a new resource when saving an form. I'm using the EditRecord as my parent page but I'm overriding some methods. For what I've seen I could override the save() method. What I'm doing is if a condition is met Instead of updating the model I create a new one and I assign it via $this->record. It seems to be working fine for the root model but this have two issues when relations comes in play. The saveRelations() chain is called this causes the child relations to be saved on the old $record. To avoid this I can set the $record to null before the validation, this will fail on the saveRelationsBeforeChildren() or similar method name. While the "before" chain has been stopped from saving, at this point I have the new root Model saved. I want to proceed with saving the relations, at this point the child relations are still saved with the wrong ID as the $record is cached in most of the components. Any idea to achieve this behavior?
1 replies
FFilament
Created by hitech95 on 6/18/2024 in #❓┊help
Wizard pre-fill from template is it possible to achieve?
Hi, I'm trying to get a form to be pre-filled by a template. For example I might have a set of templates that I can select to fill a section of the form of a specific resource. This section (In my case) is a relation (repeater). My Idea is to create a Wizard action on "add" of the repeater where on first step it ask me to choose a template (select) and on second step it shows the selected template and you can apply the necessary changes. Is something like this possible?
1 replies