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

declare(strict_types=1);

namespace 
AppModels;

use 
IlluminateDatabaseEloquentRelationsBelongsTo;

/**
 * Class Rating
 *
 * @property int id
 * @property int user_id
 * @property int recipient_id
 * @property string text
 * @property string vote
 * @property int created_at
 */
class Rating extends BaseModel
{
    
/**
     * The table associated with the model.
     *
     * @var string
     */
    
protected $table 'rating';

    
/**
     * Indicates if the model should be timestamped.
     */
    
public $timestamps false;

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

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