© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
3 replies
@maticl

Pass data from parent modal to child

Hello,

I have a usecase where I want to alert user that a specific action will dispatch unreversable data changes, and he needs to confirm it.

For example, a specific department has N services with external role (for example admin on it).
User goes to change the role on a specific service in the department via table action.
When he submits the form, we want to show which users will be affected by this change (tickets will be opened to change the role on the service) and he has to confirm.

To implement this, I need the newly selected role from parent model.
If I inject data argument into action() method, it's always empty.

Code for action:
$this->modalFooterActions([
    Action::make('submit')
        ->form([
             // some display data here (maybe should use infolist)
        ])
        ->fillForm(function (array $data) {
            // Need parent data here
        })
        ->modalWidth('md')
        ->cancelParentActions()
        ->action(function (array $data) {
            // Execute the action here
        }),
    $this->getModalCancelAction()
]);
$this->modalFooterActions([
    Action::make('submit')
        ->form([
             // some display data here (maybe should use infolist)
        ])
        ->fillForm(function (array $data) {
            // Need parent data here
        })
        ->modalWidth('md')
        ->cancelParentActions()
        ->action(function (array $data) {
            // Execute the action here
        }),
    $this->getModalCancelAction()
]);
Solution
Figured out you can get it from mountedtableactions:
->fillForm(function (Component $livewire) {
    dd($livewire->mountedTableActionsData[0]);
    // Need parent data here
})
->fillForm(function (Component $livewire) {
    dd($livewire->mountedTableActionsData[0]);
    // Need parent data here
})
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Close Modal From Child & Parent
FilamentFFilament / ❓┊help
5mo ago
how to get data in action child from action parent?
FilamentFFilament / ❓┊help
2y ago
Widget pass parent record data to CreateAction
FilamentFFilament / ❓┊help
3y ago
how to pass data from modal to component in filament?
FilamentFFilament / ❓┊help
2y ago