Mombei
Mombei
FFilament
Created by Mombei on 4/23/2025 in #❓┊help
$get() scope for Repeater actions
Hello, I'm trying to customize a Repeater's DeleteAction through the deleteAction() method, and I'm using a closure to configure the $action:
//

Repeater::make('relationshipName')
->relationship()
//other configuration
->deleteAction(fn(Action $action) => $action->requiresConfirmation(fn(Get $get) => debug($get('*'))));

//
//

Repeater::make('relationshipName')
->relationship()
//other configuration
->deleteAction(fn(Action $action) => $action->requiresConfirmation(fn(Get $get) => debug($get('*'))));

//
the debug output suggests the $get is scoped to the parent, not the repeater item (which I understand only happens inside the repeater schema itself):
array:5 [▼
0 => null
1 => 0
2 => array:13 [▶]
3 => array:1 [▶]
4 => array:3 [▼ //repeater items
"6239daa3-527e-453e-b75f-60c20019f870" => array:6 [▼
//repeater item fields
],
//other repeater items
]
]
array:5 [▼
0 => null
1 => 0
2 => array:13 [▶]
3 => array:1 [▶]
4 => array:3 [▼ //repeater items
"6239daa3-527e-453e-b75f-60c20019f870" => array:6 [▼
//repeater item fields
],
//other repeater items
]
]
Is there a workaround, if not an intended method, to access the repeater item fields inside the deleteAction() closure? I would like the deletion to only ask for confirmation if a specific required field within the repeater has been filled. I have also tried injecting the $get in the first closure and invoking it in the second closure without parameters
2 replies
FFilament
Created by Mombei on 2/24/2025 in #❓┊help
Relation Manager in Tab component of parent Resource
What I am trying to do: I want my "Accounts" resource to have tabbed Relation Managers for its Many-to-Many relationships. The reason I want the Relation Manager inside a Tab component on the parent resource is because I need the editable "name" form field to be displayed outside of the tabs, on top, so it's always visible. What I did: I have tried declaring
public function hasCombinedRelationManagerTabsWithContent(): bool
{
return true;
}
public function hasCombinedRelationManagerTabsWithContent(): bool
{
return true;
}
in the EditAccount.php of the Resource pages My issue/the error: the above solution puts the entire content of my EditForm in its own tab, which is different from my requirement. Do I need to code a custom view/component or use some Livewire workarounds? This is my first project in Laravel (but not my first in php) and I've been following the documentation
6 replies