<?php

namespace App\Models;

use App\Models\User;
use Illuminate\Database\Eloquent\Model;

/**
 * @package App\Models
 * @property int $id
 * @property int|null $user_id
 * @property string $token
 * @property string $device_id
 * @property string $device_name
 * @property string $device_type
 *
 * @property-read User $user
 */
class Firebase extends Model
{
    public $timestamps = false;

    protected $fillable = [
        'user_id', 'token', 'device_id', 'device_name', 'device_type'
    ];

    protected $casts = [
        'user_id' => 'integer',
        'token' => 'string'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
