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

declare(strict_types=1);

namespace 
AppModels;

use 
IlluminateDatabaseEloquentRelationsBelongsTo;

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

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

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