<?php

namespace Kylin\Dictionary\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Kylin\Core\Models\BaseModel;

/**
 * 字典项模型
 *
 * 字典类型下的具体数据项，如"男"、"女"。
 *
 * @property string $label 标签
 * @property string $value 值
 * @property int    $sort  排序
 */
class DictItem extends BaseModel
{
    protected $table = 'kylin_dict_items';

    protected $fillable = ['type_id', 'label', 'value', 'sort', 'description', 'status'];

    public function type(): BelongsTo
    {
        return $this->belongsTo(DictType::class, 'type_id');
    }
}
