Skip to content

Commit

Permalink
add method to get ajax uploaders
Browse files Browse the repository at this point in the history
  • Loading branch information
pxpm committed Feb 6, 2024
1 parent 8221586 commit b5c5ce0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/Library/Uploaders/Support/UploadersRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,18 @@ public function getRegisteredUploadNames(string $uploadName): array
return $uploader->getName();
}, $this->getRepeatableUploadersFor($uploadName));
}

/**
* Get the uploaders classes for the given group of uploaders
*/
public function getAjaxUploadTypes(string $group = 'withFiles'): array
{
$ajaxFieldTypes = [];
foreach($this->uploaderClasses[$group] as $fieldType => $uploader) {
if(is_a($uploader, 'Backpack\Pro\Uploads\AjaxUploaderInterface', true)) {
$ajaxFieldTypes[] = $fieldType;
}
}
return $ajaxFieldTypes;
}
}

0 comments on commit b5c5ce0

Please sign in to comment.