Editable submission File input support (#120)

This commit is contained in:
Chirag Chhatrala
2023-04-26 20:35:02 +05:30
committed by GitHub
parent 3f2fe352e8
commit e165242e57
4 changed files with 44 additions and 4 deletions

View File

@@ -168,7 +168,7 @@ class AnswerFormRequest extends FormRequest
return ['boolean'];
case 'url':
if (isset($property['file_upload']) && $property['file_upload']) {
$this->requestRules[$property['id'].'.*'] = [new StorageFile($this->maxFileSize)];
$this->requestRules[$property['id'].'.*'] = [new StorageFile($this->maxFileSize, [], $this->form)];
return ['array'];
}
return ['url'];
@@ -177,7 +177,7 @@ class AnswerFormRequest extends FormRequest
if($this->form->is_pro && !empty($property['allowed_file_types'])){
$allowedFileTypes = explode(",", $property['allowed_file_types']);
}
$this->requestRules[$property['id'].'.*'] = [new StorageFile($this->maxFileSize, $allowedFileTypes)];
$this->requestRules[$property['id'].'.*'] = [new StorageFile($this->maxFileSize, $allowedFileTypes, $this->form)];
return ['array'];
case 'email':
return ['email:filter'];