public static function getFileSafe(
        string $uploadField,
        Request $request
    ) {
        if (!$request) {
            return null;
        }

        $uploadedFile = $request->file($uploadField);

        //check type because request file method, may returns UploadedFile, array or null
        if (!is_a($uploadedFile, UploadedFile::class)) {
            return null;
        }

        return $uploadedFile;
    }