© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6d ago•
8 replies
Falaxy

How can I get the value of an input from the parent schema from within an action?

✅ Solved5️⃣v5
I am trying to hide an input fieldin an action based on a setting in the main schema

Is there a way to get the value of an input from the parent schema from within a function inside the action schema?
->hidden() to be specific

The utility function $get is scoped to the schema of the action
I also tried
$get('../parent_field')
$get('../parent_field')
with no luck
Solution
Can you try that?

Section::make('User Information')
  ->schema([
      TextInput::make('first_name'),
      TextInput::make('last_name'),
      Radio::make('flag')->options([
          'Admin' => 'Admin',
          'Student' => 'Student',
      ])->required(),
      Action::make('test_action')->schema([
          TextInput::make('additional_information')
              ->hidden(fn ($livewire) =>$livewire->data['flag'] === 'Admin'),
          
          TextInput::make('another field'),
      ])->action(function () {
          return true;
      })
  ]),
Section::make('User Information')
  ->schema([
      TextInput::make('first_name'),
      TextInput::make('last_name'),
      Radio::make('flag')->options([
          'Admin' => 'Admin',
          'Student' => 'Student',
      ])->required(),
      Action::make('test_action')->schema([
          TextInput::make('additional_information')
              ->hidden(fn ($livewire) =>$livewire->data['flag'] === 'Admin'),
          
          TextInput::make('another field'),
      ])->action(function () {
          return true;
      })
  ]),
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

Generating the value of an input from multiple input
FilamentFFilament / ❓┊help
3y ago
Get value of field within an action
FilamentFFilament / ❓┊help
3y ago
How can I get the parent Resource from RelationManager class?
FilamentFFilament / ❓┊help
16mo ago
how to Get $get value from another text input
FilamentFFilament / ❓┊help
3y ago