@php //format file size if (!function_exists('fileSizeConvert')) { function fileSizeConvert($bytes) { $bytes = floatval($bytes); $arBytes = [ 0 => [ 'UNIT' => 'TB', 'VALUE' => pow(1024, 4), ], 1 => [ 'UNIT' => 'GB', 'VALUE' => pow(1024, 3), ], 2 => [ 'UNIT' => 'MB', 'VALUE' => pow(1024, 2), ], 3 => [ 'UNIT' => 'KB', 'VALUE' => 1024, ], 4 => [ 'UNIT' => 'B', 'VALUE' => 1, ], ]; foreach ($arBytes as $arItem) { if ($bytes >= $arItem['VALUE']) { $result = $bytes / $arItem['VALUE']; $result = str_replace('.', '.', strval(round($result, 2))) . ' ' . $arItem['UNIT']; break; } } return $result ?? 000; } } @endphp @extends('layouts.admin') @section('contents')
{{--
search
--}} @foreach ($backups as $backup) @endforeach
Date File Size Action
{{ $loop->iteration }} {{ date('d-m-y H:i:s', filemtime($backup)) }} {{ pathinfo($backup)['basename'] }} {{ fileSizeConvert(filesize($backup)) }}
@endsection @section('scripts') {{-- --}} @endsection