Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion app/Enums/ResultStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;

enum ResultStatus: string implements 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.
Expand All @@ -14,4 +15,13 @@ public function getLabel(): ?string
{
return $this->name;
}

public function getColor(): ?string
{
return match ($this) {
self::Completed => 'success',
self::Failed => 'danger',
self::Started => 'warning',
};
}
}