#2 create post
This commit is contained in:
17
app/Enums/PostStatus.php
Normal file
17
app/Enums/PostStatus.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user