2025-01-03 02:11:09 +03:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace kernel\app_modules\card\models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @property string $path
|
|
|
|
|
* @property string $title
|
2025-01-19 17:15:58 +03:00
|
|
|
|
* @property string $settings
|
2025-01-03 02:11:09 +03:00
|
|
|
|
* @property int $status
|
|
|
|
|
*/
|
|
|
|
|
class CardTemplate extends Model
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
const DISABLE_STATUS = 0;
|
|
|
|
|
const ACTIVE_STATUS = 1;
|
|
|
|
|
|
|
|
|
|
protected $table = 'card_template';
|
|
|
|
|
|
2025-01-19 17:15:58 +03:00
|
|
|
|
protected $fillable = ['path', 'title', 'status', 'settings'];
|
2025-01-03 02:11:09 +03:00
|
|
|
|
|
|
|
|
|
public static function labels(): array
|
|
|
|
|
{
|
|
|
|
|
// Заполнить массив
|
|
|
|
|
// Пример: [
|
|
|
|
|
// 'label' => 'Заголовок',
|
|
|
|
|
// 'entity' => 'Сущность',
|
|
|
|
|
// 'slug' => 'Slug',
|
|
|
|
|
// 'status' => 'Статус',
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'path' => 'Шаблон',
|
|
|
|
|
'title' => 'Название',
|
2025-01-19 17:15:58 +03:00
|
|
|
|
'settings' => 'Настройки',
|
2025-01-03 02:11:09 +03:00
|
|
|
|
'status' => 'Статус',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
public static function getStatus(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
self::DISABLE_STATUS => "Не активный",
|
|
|
|
|
self::ACTIVE_STATUS => "Активный",
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|