Files
F4ilji 2997558a50 refactor: move ByteConverter from Helpers to Services namespace
- Move ByteConverter class to App\Ship\Services
- Update all imports across Filament form blocks
- Update ByteConverterServiceProvider
- Add INTEGRATION_CREDENTIAL_PREFIX to CacheKeys enum
2026-07-02 00:29:29 +05:00

17 lines
331 B
PHP
Executable File

<?php
namespace App\Ship\Services;
class ByteConverter
{
public static function bytesToHuman($bytes)
{
$units = ['Б', 'КиБ', 'МиБ', 'ГиБ', 'ТиБ', 'ПиБ'];
for ($i = 0; $bytes > 1024; $i++) {
$bytes /= 1024;
}
return round($bytes, 2) . ' ' . $units[$i];
}
}