Pre-fill support for file input (#222)
Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -40,6 +40,11 @@ class StorageFile implements Rule
|
||||
*/
|
||||
public function passes($attribute, $value): bool
|
||||
{
|
||||
// If full path then no need to validate
|
||||
if (filter_var($value, FILTER_VALIDATE_URL) !== FALSE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is use when updating a record, and file uploads aren't changed.
|
||||
if($this->form){
|
||||
$newPath = Str::of(PublicFormController::FILE_UPLOAD_PATH)->replace('?', $this->form->id);
|
||||
|
||||
Reference in New Issue
Block a user