forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResultStatus.php
More file actions
31 lines (26 loc) · 859 Bytes
/
ResultStatus.php
File metadata and controls
31 lines (26 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
enum ResultStatus: string implements HasColor, HasLabel
{
case Completed = 'completed'; // a speedtest that ran successfully.
case Failed = 'failed'; // a speedtest that failed to run successfully.
case Started = 'started'; // a speedtest that has been started by a worker but has not finish running.
public function getColor(): ?string
{
return match ($this) {
self::Completed => 'success',
self::Failed => 'danger',
self::Started => 'warning',
};
}
public function getLabel(): ?string
{
return match ($this) {
self::Completed => 'Completed',
self::Failed => 'Failed',
self::Started => 'Started',
};
}
}