raffles document uploader added / Free Resource Completed
This commit is contained in:
@@ -20,6 +20,49 @@ if (!function_exists('setting')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('getFileIcon')) {
|
||||
|
||||
function getFileIcon($extension)
|
||||
{
|
||||
switch ($extension) {
|
||||
case 'pdf':
|
||||
return ['ri-file-pdf-line', 'danger'];
|
||||
case 'doc':
|
||||
case 'docx':
|
||||
return ['ri-file-word-line', 'primary'];
|
||||
case 'xls':
|
||||
case 'xlsx':
|
||||
return ['ri-file-excel-line', 'success'];
|
||||
case 'ppt':
|
||||
case 'pptx':
|
||||
return ['ri-file-powerpoint-line', 'danger'];
|
||||
case 'txt':
|
||||
return ['ri-file-alt-line', 'secondary'];
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
case 'png':
|
||||
case 'gif':
|
||||
return ['ri-file-image-line', 'info'];
|
||||
case 'zip':
|
||||
case 'rar':
|
||||
return ['ri-file-archive-line', 'warning'];
|
||||
case 'mp3':
|
||||
case 'wav':
|
||||
return ['ri-file-audio-line', 'warning'];
|
||||
case 'mp4':
|
||||
case 'mov':
|
||||
case 'avi':
|
||||
return ['ri-file-video-line', 'warning'];
|
||||
default:
|
||||
return ['ri-file-line', 'warning'];
|
||||
}
|
||||
// return collect([
|
||||
// 'icon' => $res[0],
|
||||
// 'color' => $res[1],
|
||||
// ]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('uploadImage')) {
|
||||
function uploadImage($file, $path = 'uploads')
|
||||
{
|
||||
|
Reference in New Issue
Block a user