© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
16 replies
micraux

Pass parameter from RelationManager createAction to form

Hi,

I'm trying to have a custom create button in my RelationManager in order to create a new record with parameter(s).

I've searched and tried several things but still struggle on this.

My first idea was to populate an hidden field and use its value in order to perform some custom things, so I tried and used
beforeFormFilled()
beforeFormFilled()
but am unable to populate/retrieve the value.

I don't know if I can use an url then access the request().

Can someone help me and point me to the right direction?
Solution
Ok, I managed to do it:
->beforeFormFilled(
    function ($livewire) {
        $livewire->mountedTableActionsData[0]['action_type'] = 'test';
    }
)
->form([
    Forms\Components\TextInput::make('whatever')
        ->default(
            fn (Get $get) => $get('action_type')
        ),
])
->beforeFormFilled(
    function ($livewire) {
        $livewire->mountedTableActionsData[0]['action_type'] = 'test';
    }
)
->form([
    Forms\Components\TextInput::make('whatever')
        ->default(
            fn (Get $get) => $get('action_type')
        ),
])

I don't know if it is the best/simplest way to do it, but that works!

Thanks again, guys! 👍
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

test relationmanager CreateAction
FilamentFFilament / ❓┊help
15mo ago
How to send parameter to CreateAction?
FilamentFFilament / ❓┊help
17mo ago
Pass URL parameter from Page to Widget
FilamentFFilament / ❓┊help
2y ago
Pass data from ViewRecord to a RelationManager class
FilamentFFilament / ❓┊help
17mo ago