You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
633 B
PHP
20 lines
633 B
PHP
<?php
|
|
namespace App\Helper;
|
|
|
|
class FileHelper {
|
|
static $allowedVideoExtensions = ['mp4', 'mkv'];
|
|
static $allowedApkExtensions = ['apk'];
|
|
|
|
static function convertToStrJsValidation(array $allowedFileExtensions) {
|
|
// add leading '.' for every extension;
|
|
foreach($allowedFileExtensions as &$allowedFileExtension) { $allowedFileExtension = ".$allowedFileExtension"; }
|
|
unset($allowedFileExtension);
|
|
|
|
return implode(', ', $allowedFileExtensions);
|
|
}
|
|
|
|
static function convertToStrLaraValidation(array $allowedFileExtensions) {
|
|
return implode(',', $allowedFileExtensions);
|
|
}
|
|
}
|
|
?>
|