<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class UserRouteItem extends Model
{
    use HasFactory;

    protected $table = 'user_route_items';

    protected $fillable = [
        'user_id',
        'ponto_id',
        'checkin_id',
        'ordem',
        'visitado_em',
    ];

    protected $casts = [
        'visitado_em' => 'datetime',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function ponto()
    {
        return $this->belongsTo(PontoTuristico::class, 'ponto_id');
    }

    public function checkin()
    {
        return $this->belongsTo(Checkin::class);
    }
}
