<?php

namespace App\Models;

use App\Libs\Database\Eloquent\ContentTypeModel;
use App\Models\GenericBackoffice\Traits\LanguageSupportTrait;
use MatanYadaev\EloquentSpatial\Traits\HasSpatial;
use MatanYadaev\EloquentSpatial\Objects\Point;

class City extends ContentTypeModel
{
    use LanguageSupportTrait;
    use HasSpatial;

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

    protected $dates = []; // dates

    protected $casts = [
        'map_position' => Point::class
    ];

    public function cityZones()
    {
        return $this->hasMany(CityZone::class);
    }

    public function country()
    {
        return $this->belongsTo(Country::class);
    }
}
