mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-17 15:52:15 +00:00
test refactoring
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Admin\Controllers\Dashboard;
|
||||
|
||||
use ByteUnits\Metric;
|
||||
@@ -66,13 +65,13 @@ class GetDashboardDataController extends Controller
|
||||
->groupBy('created_at')
|
||||
->get();
|
||||
|
||||
$upload = $trafficRecords->map(fn($record) => [
|
||||
$upload = $trafficRecords->map(fn ($record) => [
|
||||
'created_at' => format_date($record->created_at, '%d. %B'),
|
||||
'percentage' => intval($trafficRecords->max('upload')) !== 0 ? round(($record->upload / $trafficRecords->max('upload')) * 100, 2) : 0,
|
||||
'amount' => Metric::bytes($record->upload)->format(),
|
||||
]);
|
||||
|
||||
$download = $trafficRecords->map(fn($record) => [
|
||||
$download = $trafficRecords->map(fn ($record) => [
|
||||
'created_at' => format_date($record->created_at, '%d. %B'),
|
||||
'percentage' => intval($trafficRecords->max('download')) !== 0 ? round(($record->download / $trafficRecords->max('download')) * 100, 2) : 0,
|
||||
'amount' => Metric::bytes($record->download)->format(),
|
||||
|
||||
Reference in New Issue
Block a user