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'));
Was this page helpful?