initial commit
This commit is contained in:
36
app/Enums/InvoiceStatus.php
Normal file
36
app/Enums/InvoiceStatus.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum InvoiceStatus: string
|
||||
{
|
||||
case Draft = 'draft';
|
||||
case Sent = 'sent';
|
||||
case Paid = 'paid';
|
||||
case Overdue = 'overdue';
|
||||
case Cancelled = 'cancelled';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::Draft => 'Draft',
|
||||
self::Sent => 'Sent',
|
||||
self::Paid => 'Paid',
|
||||
self::Overdue => 'Overdue',
|
||||
self::Cancelled => 'Cancelled',
|
||||
};
|
||||
}
|
||||
|
||||
public function badgeClass(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::Draft => 'badge-ghost',
|
||||
self::Sent => 'badge-info',
|
||||
self::Paid => 'badge-success',
|
||||
self::Overdue => 'badge-error',
|
||||
self::Cancelled => 'badge-neutral',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user