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
38 lines (33 loc) · 950 Bytes
/
ResultStatus.php
File metadata and controls
38 lines (33 loc) · 950 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
32
33
34
35
36
37
38
<?php
namespace App\Enums;
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
use Illuminate\Support\Str;
enum ResultStatus: string implements HasColor, HasLabel
{
case Benchmarking = 'benchmarking';
case Checking = 'checking';
case Completed = 'completed';
case Failed = 'failed';
case Running = 'running';
case Started = 'started';
case Skipped = 'skipped';
case Waiting = 'waiting';
public function getColor(): ?string
{
return match ($this) {
self::Benchmarking => 'info',
self::Checking => 'info',
self::Completed => 'success',
self::Failed => 'danger',
self::Running => 'info',
self::Started => 'info',
self::Skipped => 'gray',
self::Waiting => 'info',
};
}
public function getLabel(): ?string
{
return Str::title($this->name);
}
}