© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•14mo ago•
19 replies
lbar

modal form passing value from the action

In my view I have the following action:
{{ ($this->subscribeMemberAction)(['member_id' => $member->id]) }}
{{ ($this->subscribeMemberAction)(['member_id' => $member->id]) }}

this work pretty well, and I'm able to fetch my data from fillForm on the component:
return Action::make('subscribeMember')
       ->fillForm(function (array $arguments){
            return Member::where('id', '=', $arguments['member_id'])->first()->toArray();
       )
[...]
return Action::make('subscribeMember')
       ->fillForm(function (array $arguments){
            return Member::where('id', '=', $arguments['member_id'])->first()->toArray();
       )
[...]

but I need to pre-fetch some options (extracting them from database) using the same $arguments['member_id']. So something like this, but here the $arguments is not available
[...]
->schema([
    Radio::make('member_certificates')
      ->options(function ($arguments){
           // here $arguments['member_id'] is not available
           return MemberCertificate::where('member_id', '=', $arguments['member_id'])->pluck('id','expire_Date')->toArray();
           })
])
[...]
[...]
->schema([
    Radio::make('member_certificates')
      ->options(function ($arguments){
           // here $arguments['member_id'] is not available
           return MemberCertificate::where('member_id', '=', $arguments['member_id'])->pluck('id','expire_Date')->toArray();
           })
])
[...]


Any clue on how to archive that?
Thank you
Solution
try only this

return Actions\Action::make('subscribeMember')
    ->mountUsing(function (Form $form, array $arguments) {
        $form->getComponent($form->getStatePath() . '.member_certificates')
            ->options(fn() => MemberCertificate::whereMemberId($arguments['member_id'])
                ->pluck('id', 'expire_Date')
            );
    })
    ->steps([
        Step::make('Documents')
            ->schema([
                Radio::make('member_certificates')
            ]),
    ]);
return Actions\Action::make('subscribeMember')
    ->mountUsing(function (Form $form, array $arguments) {
        $form->getComponent($form->getStatePath() . '.member_certificates')
            ->options(fn() => MemberCertificate::whereMemberId($arguments['member_id'])
                ->pluck('id', 'expire_Date')
            );
    })
    ->steps([
        Step::make('Documents')
            ->schema([
                Radio::make('member_certificates')
            ]),
    ]);
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

Update Form from Action Modal
FilamentFFilament / ❓┊help
2y ago
Pass value from Modal form to Action on list page
FilamentFFilament / ❓┊help
3y ago
Form Builder: Modal-Form Action
FilamentFFilament / ❓┊help
3y ago
is it possible to get value from parent form with form action modal?
FilamentFFilament / ❓┊help
15mo ago