F
Filament3mo ago
Mafdet

getMountedTableActionRecord() returns null in RelationManager (EditAction)

I'm building a RelationManager for MenuItem -> VariationGroups, where each variation group has multiple options, and each option has multiple ingredients. This is a nested repeater structure (options → ingredients), and I want to load existing nested data into the form when editing. I’ve already implemented mutateFormDataBeforeFill, but it’s not being called when I click the Edit action on the relation manager. I tried adding a custom mount() method and manually calling $this->form->fill([...]), but even then, getMountedTableActionRecord() returns null. My data saves correctly, but my problem is only on the form preloading (not saving). What I've Tried? Implemented mutateFormDataBeforeFill() → not triggered Tried mount() override → getMountedTableActionRecord() returns null Tried using ->default(fn () => $this->loadOptions()) in the Repeater → but it only works on create, not edit Verified data exists (the group, options, and ingredients are loaded properly) Code Context Using RelationManager, nested repeaters like this: Repeater::make('options') ->schema([ // ... Repeater::make('ingredients')->schema([ Select::make('inventory_item_id'), TextInput::make('quantity'), Select::make('unit'), ]), ]) What I Need Help With? What’s the correct way to preload nested repeater data inside a RelationManager? Why is mutateFormDataBeforeFill() not firing when editing a relation row? Is there a better hook than mount() for injecting default form data when editing?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?