27 lines
425 B
PHP
27 lines
425 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum ContentType: string
|
|
{
|
|
case PAGE = 'page';
|
|
case POST = 'post';
|
|
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::PAGE => 'Laman',
|
|
self::POST => 'Pos',
|
|
};
|
|
}
|
|
|
|
public function value(): string
|
|
{
|
|
return match ($this) {
|
|
self::PAGE => 'page',
|
|
self::POST => 'post',
|
|
};
|
|
}
|
|
}
|