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

declare(strict_types=1);

namespace 
AppModels;

use 
IlluminateDatabaseEloquentRelationsBelongsTo;
use 
IlluminateSupportCollection;

/**
 * Class User
 *
 * @property int id
 * @property int user_id
 * @property int field_id
 * @property string value
 * @property Collection<UserField> field
 */
class UserData extends BaseModel
{
    
/**
     * Indicates if the model should be timestamped.
     */
    
public $timestamps false;

    
/**
     * The attributes that are mass assignable.
     *
     * @var string[]
     */
    
protected $fillable = [
        
'value',
        
'field_id',
    ];

    
/**
     * Return field
     */
    
public function field(): BelongsTo
    
{
        return 
$this->belongsTo(UserField::class, 'field_id')->withDefault();
    }
}
Онлайн: 8
Реклама