-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e10d549
commit 8ca89c3
Showing
5 changed files
with
70 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace App\Filament\Enums; | ||
|
||
use Filament\Support\Contracts\HasColor; | ||
use Filament\Support\Contracts\HasIcon; | ||
use Filament\Support\Contracts\HasLabel; | ||
|
||
enum BackupStatus: string implements HasColor, HasIcon, HasLabel | ||
{ | ||
case Pending = 'pending'; | ||
case Processing = 'processing'; | ||
case Completed = 'completed'; | ||
case Failed = 'failed'; | ||
case Cancelled = 'cancelled'; | ||
|
||
public function getLabel(): string | ||
{ | ||
return match ($this) { | ||
self::Pending => 'Pending', | ||
self::Processing => 'Processing', | ||
self::Completed => 'Completed', | ||
self::Failed => 'Failed', | ||
self::Cancelled => 'Cancelled', | ||
}; | ||
} | ||
|
||
public function getColor(): string | array | null | ||
{ | ||
return match ($this) { | ||
self::Pending => 'info', | ||
self::Cancelled => 'warning', | ||
self::Processing => 'warning', | ||
self::Completed => 'success', | ||
self::Failed => 'danger', | ||
}; | ||
} | ||
|
||
public function getIcon(): ?string | ||
{ | ||
return match ($this) { | ||
self::Pending => 'heroicon-m-sparkles', | ||
self::Processing => 'heroicon-m-arrow-path', | ||
self::Cancelled => 'heroicon-m-truck', | ||
self::Completed => 'heroicon-m-check-badge', | ||
self::Failed => 'heroicon-m-x-circle', | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters