<?php

namespace App\Models;

use App\Libs\Database\Eloquent\ContentTypeModel;
use App\Models\GenericBackoffice\Traits\LanguageSupportTrait;

class Route extends ContentTypeModel
{
    const TYPE_LOCAL = 'local';
    const TYPE_INTERCITY = 'intercity';

    use LanguageSupportTrait;

    protected $hidden = ['languages', "websites"];
    protected $with = ['languages', "websites"];

    public function waypoints()
    {
        return $this->belongsToMany(Property::class)->withPivot('position')->withTimestamps();
    }

    public function icon()
    {
        return $this->belongsTo(MediaItem::class);
    }
}
