We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2640b06 commit d22db76Copy full SHA for d22db76
app/Enums/ResultStatus.php
@@ -2,9 +2,10 @@
2
3
namespace App\Enums;
4
5
+use Filament\Support\Contracts\HasColor;
6
use Filament\Support\Contracts\HasLabel;
7
-enum ResultStatus: string implements HasLabel
8
+enum ResultStatus: string implements HasColor, HasLabel
9
{
10
case Completed = 'completed'; // a speedtest that ran successfully.
11
case Failed = 'failed'; // a speedtest that failed to run successfully.
@@ -14,4 +15,13 @@ public function getLabel(): ?string
14
15
16
return $this->name;
17
}
18
+
19
+ public function getColor(): ?string
20
+ {
21
+ return match ($this) {
22
+ self::Completed => 'success',
23
+ self::Failed => 'danger',
24
+ self::Started => 'warning',
25
+ };
26
+ }
27
0 commit comments