© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
Kyrill71

Hide field based on file upload.

Hello,
i'm trying to make an option field hidden based on if a file is uploaded in the fileupload component.
but when i tried the code below it gives me this error:
'Cannot use empty array elements in arrays' on the reactive function. Is there another approach I can use to hide the option field based on the file upload, or is there a workaround to resolve this issue?

self::getFileUploadComponent(name:'facturen_array', label: 'invoice')->reactive();
Radio::make('type')
    ->options([
        'kasbetaling' => 'kasbetaling',
        'credit factuur' => 'credit factuur',
    ])->label('papertype')->hidden(fn (Closure $get): bool => !$get('facturen_array'));
self::getFileUploadComponent(name:'facturen_array', label: 'invoice')->reactive();
Radio::make('type')
    ->options([
        'kasbetaling' => 'kasbetaling',
        'credit factuur' => 'credit factuur',
    ])->label('papertype')->hidden(fn (Closure $get): bool => !$get('facturen_array'));
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 hide placeholder of file upload field?
FilamentFFilament / ❓┊help
2y ago
Dependent file upload option based on select field in form
FilamentFFilament / ❓┊help
2y ago
Simple file upload field
FilamentFFilament / ❓┊help
3y ago
Hide relation manager based on state of form field
FilamentFFilament / ❓┊help
2y ago