© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
FranDev

i need to pass a form component as parameter to another form component

I need the value of a select form component when a given input form component is not hidden, like this:

Select::make('client_category')
                ->options($categories->pluck('descripcion', 'id')->toArray())
                ->searchable()
                ->live(onBlur: true)
                ->default($default),
TextInput::make('name')
    ->hidden(function (Get $get, Set $set, Component $component):bool {
        if($get('client_category') != null) {
          dd($component); //i need the $component from the select
            return false;
                  }
                  return true;
              })
Select::make('client_category')
                ->options($categories->pluck('descripcion', 'id')->toArray())
                ->searchable()
                ->live(onBlur: true)
                ->default($default),
TextInput::make('name')
    ->hidden(function (Get $get, Set $set, Component $component):bool {
        if($get('client_category') != null) {
          dd($component); //i need the $component from the select
            return false;
                  }
                  return true;
              })


In the documentation: https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-form-component-instance, i tried this:

use Filament\Forms\Components\Component;
 
function (Component $component) {
    // ...
}
use Filament\Forms\Components\Component;
 
function (Component $component) {
    // ...
}


but that gives me the current form component, what i need is the component of another form field, because i want to extract the text present on the selected option of the select field

If you can help me achieve this, or guide me to the right way.. thanks in advance!
Advanced forms - Form Builder - Filament
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Pass parameter from RelationManager createAction to form
FilamentFFilament / ❓┊help
2y ago
Accessing a form component from another
FilamentFFilament / ❓┊help
2y ago
How can I pass size parameter to the ToggleButtons component ?
FilamentFFilament / ❓┊help
11mo ago
Pass array as parameter in Resource::getUrl
FilamentFFilament / ❓┊help
2y ago