MicroFrameWork/kernel/models/Menu.php
2024-09-04 16:47:05 +03:00

50 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace kernel\models;
use app\helpers\Debug;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int parent_id
* @property string icon_file
* @property string icon_font
* @property string label
* @property string url
* @property int status
* @method static find($id)
*/
class Menu extends Model
{
const DISABLE_STATUS = 0;
const ACTIVE_STATUS = 1;
protected $table = 'menu';
protected $fillable = ['parent_id', 'icon_file', 'icon_font', 'label', 'url', 'status'];
protected array $dates = ['deleted_at'];
public static function labels(): array
{
return [
'label' => 'Заголовок',
'parent_id' => 'Родительский пункт меню',
'icon_file' => 'Путь к иконке',
'icon_font' => 'Иконка',
'url' => 'URL',
'status' => 'Статус',
];
}
/**
* @return string[]
*/
public static function getStatus(): array
{
return [
self::DISABLE_STATUS => "Не активный",
self::ACTIVE_STATUS => "Активный",
];
}
}