© 2026 Hedgehog Software, LLC

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

Dependent file upload option based on select field in form

I need to have a different directory for an file upload field based on a selected option:

so I have an option in a select field:

Select::make('first')
    ->options([
        'one' => 'One',
        'two' => 'Two',
        'three' => 'Three',
    ])
    ->live(),
    
FileUpload::make('second')
    ->disk('s3')
    ->directory('download' . '/' . <here-will-be-one-two-or-three>)
Select::make('first')
    ->options([
        'one' => 'One',
        'two' => 'Two',
        'three' => 'Three',
    ])
    ->live(),
    
FileUpload::make('second')
    ->disk('s3')
    ->directory('download' . '/' . <here-will-be-one-two-or-three>)


How to add one or two or three instead of here-will-be-one-two-or-three placeholder based on what I select in the 'first' select box?

Basically, I want to store the file in different folders based on what the user selects in options of select box.
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

Position of element in Dependent Select Field Option
FilamentFFilament / ❓┊help
3y ago
Hide field based on file upload.
FilamentFFilament / ❓┊help
3y ago
Based on select option set regex in text input field
FilamentFFilament / ❓┊help
2y ago