/
DATKAI
/
ITCUP
Обзор
Документация
Войти
/
DATKAI
/
ITCUP
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
app/Models/Contact.php
45 строк
1 KB
DATKAI
feat(comms): адресная книга, структура компании, CardDAV-синхронизация
03 июл 2026, 08:10
03 июл 2026, 08:10
db69ed1
Код
Авторство
О чём код?
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class Contact extends Model { protected $fillable = [ 'name', 'organization', 'position', 'category', 'email', 'email2', 'phone', 'mobile', 'address', 'branch_id', 'notes', 'is_active', 'created_by', ]; protected $casts = [ 'is_active' => 'boolean', ]; public const CATEGORIES = [ 'partner' => 'Партнёры / контрагенты', 'vendor' => 'Поставщики', 'service' => 'Сервисные службы', 'government' => 'Гос. органы', 'other' => 'Прочее', ]; public const CATEGORY_COLORS = [ 'partner' => 'info', 'vendor' => 'warning', 'service' => 'success', 'government' => 'danger', 'other' => 'gray', ]; public function branch(): BelongsTo { return $this->belongsTo(Branch::class); } public function creator(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } }