Files
MrleeAdmin/backend/app/enum/system/MessageStatus.php
T

40 lines
807 B
PHP
Raw Normal View History

2026-08-31 11:33:59 +08:00
<?php
declare(strict_types=1);
/**
*+------------------
* madong
*+------------------
* Copyright (c) https://gitee.com/motion-code All rights reserved.
*+------------------
* Author: Mr. April (405784684@qq.com)
*+------------------
* Official Website: http://www.madong.tech
*/
namespace app\enum\system;
enum MessageStatus: string
{
case UNREAD = 'unread';
case READ = 'read';
//定义一个方法以获取状态的描述
public function label(): string
{
return match ($this) {
self::UNREAD => '未读',
self::READ => '已读',
};
}
// 设置标签颜色
public function color(): string
{
return match ($this) {
self::UNREAD => 'orange',
self::READ => 'green',
};
}
}