© 2026 Hedgehog Software, LLC

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

Can't change disabled state on fileupload

I have two fileupload fields in a form, the second is dependant on the first. I made the first input live só the form re-renders but the second input still is disabled. Is there a way to make it change it's state?

Forms\Components\FileUpload::make('cert_file')
                            ->disk('s3')
                            ->required(fn(Forms\Get $get): bool => $this->isCertificateRequired($get('api')))
                            ->live()
                            ->visibility('private')
                            ->directory('certificates')
                            ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file, RelationManager $livewire): string {
                                return (string)str($file->getClientOriginalName())
                                    ->prepend($livewire->ownerRecord->id . '-');
                            })
                            ->label('Certificado'),
                        Forms\Components\FileUpload::make('cert_key')
                            ->disk('s3')
                            ->nullable()
                            ->disabled(fn(Forms\Get $get): bool => !filled($get('cert_file')))
                            ->visibility('private')
                            ->directory('certificates')
                            ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file, RelationManager $livewire): string {
                                return (string)str($file->getClientOriginalName())
                                    ->prepend($livewire->ownerRecord->id . '-');
                            })
                            ->label('Chave privada'),
Forms\Components\FileUpload::make('cert_file')
                            ->disk('s3')
                            ->required(fn(Forms\Get $get): bool => $this->isCertificateRequired($get('api')))
                            ->live()
                            ->visibility('private')
                            ->directory('certificates')
                            ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file, RelationManager $livewire): string {
                                return (string)str($file->getClientOriginalName())
                                    ->prepend($livewire->ownerRecord->id . '-');
                            })
                            ->label('Certificado'),
                        Forms\Components\FileUpload::make('cert_key')
                            ->disk('s3')
                            ->nullable()
                            ->disabled(fn(Forms\Get $get): bool => !filled($get('cert_file')))
                            ->visibility('private')
                            ->directory('certificates')
                            ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file, RelationManager $livewire): string {
                                return (string)str($file->getClientOriginalName())
                                    ->prepend($livewire->ownerRecord->id . '-');
                            })
                            ->label('Chave privada'),
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

FileUpload with TextInput disabled.
FilamentFFilament / ❓┊help
3y ago
FileUpload.. Change file name on display?
FilamentFFilament / ❓┊help
3y ago
Change State
FilamentFFilament / ❓┊help
15mo ago
Can I change the default FileUpload Text?
FilamentFFilament / ❓┊help
2y ago