FilamentF
Filament3y ago
riz

How to check if Fileupload is filled

How to check a fileupload component is filled, like in the code
below I want to enable the toggle component only when textinput
and fileupload is filled..

I tried $get('attachments') to no avail


 Forms\Components\TextInput::make('first_name'),

 Forms\Components\FileUpload::make('attachments')
                  ->multiple(),
           
Forms\Components\Toggle::make('is_toggled')
          ->onIcon('heroicon-m-user')
          ->offIcon('heroicon-m-user')
          ->onColor('success')
          ->offColor('')
          ->dehydrated()
 ->disabled(fn (Get $get) => $get('first_name') === null)
Was this page helpful?