芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/SuperAdmin/Package.php
hasMany(Company::class); } public function formatSizeUnits($bytes) { if ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' GB'; } elseif ($bytes > 1) { $bytes = $bytes . ' MB'; } else { $bytes = '0 MB'; } return $bytes; } /** * Convert bytes to megabytes (MB). * * @param int $bytes * @return float */ public static function bytesToMB($bytes) { return round($bytes / 1048576, 2); } /** * Convert bytes to gigabytes (GB). * * @param int $bytes * @return float */ public static function bytesToGB($bytes) { return round($bytes / 1073741824, 2); } /** * Convert bytes to gigabytes (GB) and megabytes (MB). * * @param int $bytes * @return string */ public static function bytesToGBMB($bytes) { $gb = round($bytes / 1073741824, 2); $mb = round($bytes / 1048576, 2); if ($gb > 0) { return $gb . ' GB'; } else { return $mb . ' MB'; } } public function currency() { return $this->belongsTo(GlobalCurrency::class, 'currency_id')->withTrashed(); } public function getFormattedAnnualPriceAttribute() { return global_currency_format($this->annual_price, $this->currency_id); } public function getFormattedMonthlyPriceAttribute() { return global_currency_format($this->monthly_price, $this->currency_id); } }