This commit is contained in:
2025-06-18 14:50:18 +03:00
parent a64ed080bb
commit 4c716a8a8c
160 changed files with 6786 additions and 23 deletions

View File

@ -0,0 +1,61 @@
<?php
namespace kernel\app_modules\event\models;
use Illuminate\Database\Eloquent\Model;
// Добавить @property
/**
* @property int $id
* @property int $status
* @property int $event_id
* @property string $title
* @property string $type
*/
class EventContact extends Model
{
const DISABLE_STATUS = 0;
const ACTIVE_STATUS = 1;
const TYPE_EMAIL = 'email';
const TYPE_PHONE = 'phone';
const TYPE_TG = 'tg';
protected $table = 'event_contact';
protected $fillable = ['title', 'type', 'event_id', 'status']; // Заполнить массив. Пример: ['label', 'slug', 'status']
public static function labels(): array
{
return [
'title' => 'Название',
'type' => 'Тип',
'event_id' => 'Мероприятие',
'status' => 'Статус',
];
}
/**
* @return string[]
*/
public static function getStatus(): array
{
return [
self::DISABLE_STATUS => "Не активный",
self::ACTIVE_STATUS => "Активный",
];
}
/**
* @return string[]
*/
public static function getTypes(): array
{
return [
self::TYPE_EMAIL => "Email",
self::TYPE_PHONE => "Телефон",
self::TYPE_TG => "Телеграм",
];
}
}