© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Mansoor Khan

How to get Field component data/config in Form Action

Can we get the field component data or the configurations in the mounted form action?

Forms\Components\FileUpload::make('image')
  ->disk('public')
  ->directory('posts/featured-images')
  ->hintAction(
    Action::make('custom_action')
      ->action(function () {
        // get the disk and directory from the field
      })
  ),
Forms\Components\FileUpload::make('image')
  ->disk('public')
  ->directory('posts/featured-images')
  ->hintAction(
    Action::make('custom_action')
      ->action(function () {
        // get the disk and directory from the field
      })
  ),
Solution
Upload image from URL

Just learned form Ralph that we can use $component variable to get the Field itself on which the action is mounted.


->action(function (FileUpload $component)
->action(function (FileUpload $component)
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to get $data from table form action?
FilamentFFilament / ❓┊help
2y ago
get form data from action
FilamentFFilament / ❓┊help
3y ago
How to get file in action form
FilamentFFilament / ❓┊help
2y ago
Action form how send data ?
FilamentFFilament / ❓┊help
2y ago