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

declare(strict_types=1);

namespace 
AppModels;

use 
CarbonCarbonImmutable;
use 
IlluminateDatabaseEloquentModel;
use 
IlluminateDatabaseEloquentRelationsBelongsTo;

/**
 * Class Online
 *
 * @property string          $ip
 * @property string          $brow
 * @property int             $user_id
 * @property CarbonImmutable $updated_at
 */
class Online extends Model
{
    
/**
     * The table associated with the model.
     */
    
protected $table 'online';

    
/**
     * The primary key for the model.
     */
    
protected $primaryKey 'uid';

    
/**
     * Indicates if the IDs are auto-incrementing.
     */
    
public $incrementing false;

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

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

    
/**
     * Get the attributes that should be cast.
     */
    
protected function casts(): array
    {
        return [
            
'user_id'    => 'int',
            
'updated_at' => 'datetime',
        ];
    }

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