Skip to content

Commit 8dfc9e5

Browse files
authored
Merge branch 'main' into feature/add-webhook-notifications
2 parents 4447651 + 152e9c5 commit 8dfc9e5

File tree

24 files changed

+1825
-626
lines changed

24 files changed

+1825
-626
lines changed

.env.testing

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DB_USERNAME=root
1616
DB_PASSWORD=
1717

1818
BROADCAST_DRIVER=log
19-
CACHE_DRIVER=file
19+
CACHE_DRIVER=database
2020
FILESYSTEM_DISK=local
2121
QUEUE_CONNECTION=database
2222
SESSION_DRIVER=database

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
5353

5454
- name: Setup composer cache
55-
uses: actions/cache@v3
55+
uses: actions/cache@v4
5656
with:
5757
path: ${{ steps.composer-cache.outputs.dir }}
5858
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}

.phpstorm.meta.php

Lines changed: 33 additions & 0 deletions
Large diffs are not rendered by default.

_ide_helper.php

Lines changed: 1078 additions & 132 deletions
Large diffs are not rendered by default.

app/Helpers/Number.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace App\Helpers;
4+
5+
use Illuminate\Support\Number as SupportNumber;
6+
7+
class Number extends SupportNumber
8+
{
9+
/**
10+
* Convert the given number to its file size equivalent in bits.
11+
*/
12+
public static function fileSizeBits(int|float $bits, int $precision = 0, ?int $maxPrecision = null, bool $perSecond = false): string
13+
{
14+
$units = match ($perSecond) {
15+
true => ['Bps', 'Kbps', 'Mbps', 'Gbps', 'Tbps', 'Pbps', 'Ebps', 'Zbps', 'Ybps'],
16+
default => ['B', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb']
17+
};
18+
19+
for ($i = 0; ($bits / 1024) > 0.9 && ($i < count($units) - 1); $i++) {
20+
$bits /= 1024;
21+
}
22+
23+
return sprintf('%s %s', static::format($bits, $precision, $maxPrecision), $units[$i]);
24+
}
25+
}

app/Models/Result.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Models;
44

55
use App\Events\ResultCreated;
6+
use Illuminate\Database\Eloquent\Casts\Attribute;
67
use Illuminate\Database\Eloquent\Factories\HasFactory;
78
use Illuminate\Database\Eloquent\Model;
89
use Illuminate\Support\Arr;
@@ -106,4 +107,28 @@ public function getJitterData(): array
106107
'ping' => $data['ping']['jitter'] ?? null,
107108
];
108109
}
110+
111+
/**
112+
* Get the result's download in bits.
113+
*/
114+
protected function downloadBits(): Attribute
115+
{
116+
return Attribute::make(
117+
get: fn (mixed $value): ?string => ! blank($this->download) && is_numeric($this->download)
118+
? number_format(num: $this->download * 8, decimals: 0, thousands_separator: '')
119+
: null,
120+
);
121+
}
122+
123+
/**
124+
* Get the result's upload in bits.
125+
*/
126+
protected function uploadBits(): Attribute
127+
{
128+
return Attribute::make(
129+
get: fn (mixed $value): ?string => ! blank($this->upload) && is_numeric($this->upload)
130+
? number_format(num: $this->upload * 8, decimals: 0, thousands_separator: '')
131+
: null,
132+
);
133+
}
109134
}

composer.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@
1111
"php": "^8.1",
1212
"awcodes/filament-versions": "^2.0.1",
1313
"chrisullyott/php-filesize": "^4.2.1",
14-
"doctrine/dbal": "^3.7.2",
14+
"doctrine/dbal": "^3.8.0",
1515
"dragonmantank/cron-expression": "^3.3.3",
16-
"filament/filament": "^3.1.47",
17-
"filament/spatie-laravel-settings-plugin": "^3.1.47",
16+
"filament/filament": "^3.2.23",
17+
"filament/spatie-laravel-settings-plugin": "^3.2.23",
1818
"guzzlehttp/guzzle": "^7.8.1",
1919
"influxdata/influxdb-client-php": "^3.4",
2020
"laravel-notification-channels/telegram": "^4.0",
21-
"laravel/framework": "^10.40",
21+
"laravel/framework": "^10.43",
2222
"laravel/prompts": "^0.1.15",
2323
"laravel/sanctum": "^3.3.3",
2424
"laravel/tinker": "^2.9.0",
25-
"livewire/livewire": "^3.3.5",
26-
"maatwebsite/excel": "^3.1.51",
25+
"livewire/livewire": "^3.4.4",
26+
"maatwebsite/excel": "^3.1.52",
2727
"maennchen/zipstream-php": "^2.4",
2828
"spatie/laravel-settings": "^2.8.3"
2929
},
3030
"require-dev": {
3131
"barryvdh/laravel-ide-helper": "^2.13",
3232
"fakerphp/faker": "^1.23.1",
33-
"laravel/pint": "^1.13.8",
34-
"laravel/sail": "^1.27.0",
35-
"laravel/telescope": "^4.17.3",
33+
"laravel/pint": "^1.13.10",
34+
"laravel/sail": "^1.27.3",
35+
"laravel/telescope": "^4.17.5",
3636
"mockery/mockery": "^1.6.7",
3737
"nunomaduro/collision": "^7.10.0",
38-
"phpunit/phpunit": "^10.5.5",
38+
"phpunit/phpunit": "^10.5.9",
3939
"spatie/laravel-ignition": "^2.4.1",
40-
"tightenco/duster": "^2.7"
40+
"tightenco/duster": "^2.7.3"
4141
},
4242
"autoload": {
4343
"files": [
@@ -84,6 +84,9 @@
8484
},
8585
"config": {
8686
"optimize-autoloader": true,
87+
"platform": {
88+
"php": "8.2"
89+
},
8790
"preferred-install": "dist",
8891
"sort-packages": true,
8992
"allow-plugins": {

0 commit comments

Comments
 (0)