Вход Регистрация
Файл: app/Models/Contact.php
Строк: 25
<?php

declare(strict_types=1);

namespace 
AppModels;

use 
IlluminateDatabaseEloquentRelationsBelongsTo;

/**
 * Class Contact
 *
 * @property int id
 * @property int user_id
 * @property int contact_id
 * @property string text
 * @property int created_at
 */
class Contact extends BaseModel
{
    
/**
     * Indicates if the model should be timestamped.
     */
    
public $timestamps false;

    
/**
     * The attributes that aren't mass assignable.
     */
    
protected $guarded = [];

    
/**
     * Возвращает связь пользователей
     */
    
public function contactor(): BelongsTo
    
{
        return 
$this->belongsTo(User::class, 'contact_id')->withDefault();
    }
}
Онлайн: 5
Реклама