chore: improvement middleware
parent
7dc17d8b7d
commit
d010eaba23
@ -0,0 +1,20 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue