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

declare(strict_types=1);

namespace 
AppModels;

use 
IlluminateDatabaseEloquentRelationsBelongsTo;

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

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

    
/**
     * Morph name
     */
    
public static string $morphName 'walls';

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