18 lines
300 B
PHP
18 lines
300 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum PostStatus: string
|
|
{
|
|
case Published = 'published';
|
|
case Draft = 'draft';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
PostStatus::Published => 'Published',
|
|
PostStatus::Draft => 'Draft',
|
|
};
|
|
}
|
|
}
|