<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $user_session_id
 * @property integer $user_id
 * @property string $user_name
 * @property string $login_time
 * @property string $logout_time
 * @property string $created
 * @property User $user
 */
class UserSession extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'user_session';

    /**
     * The primary key for the model.
     * 
     * @var string
     */
    protected $primaryKey = 'user_session_id';

    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'integer';

    public $timestamps = false;

    /**
     * @var array
     */
    protected $fillable = ['user_id', 'user_name', 'login_time', 'logout_time',
     'created'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo('App\Models\User', null, 'user_id');
    }
}
