<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Stancl\Tenancy\Database\Concerns\CentralConnection;

class City extends Model
{
    use CentralConnection;

    protected $hidden = [
        'name_ka',
    ];

    public function districts(): HasMany
    {
        return $this->hasMany(CityDistrict::class);
    }

    public function scopeByCityId(Builder $query, string $cityId): void
    {
        $query->where('id', $cityId);
    }
}
