<?php

namespace App\Models;

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

/**
 * @property int $id
 * @property string $common_name
 * @property string|null $native_name
 * @property string $a2_iso
 * @property string $a3_iso
 * @property int|null $default_currency_id
 * @property int|null $capital_id
 * @property string|null $region
 * @property string|null $subregion
 * @property int|null $default_language_id
 * @property string|null $coordinates
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 *
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereA2Iso($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereA3Iso($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereCapitalId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereCommonName($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereCoordinates($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereDefaultCurrencyId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereDefaultLanguageId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereNativeName($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereRegion($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereSubregion($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|Country whereUpdatedAt($value)
 *
 * @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\City> $cities
 * @property-read int|null $cities_count
 *
 * @mixin \Eloquent
 */
class Country extends Model
{
    use HasFactory;

    protected $fillable = [
        'common_name',
        'native_name',
        'a2_iso',
        'a3_iso',
        'default_currency_id',
        'capital_id',
        'region',
        'subregion',
        'default_language_id',
        'coordinates',
    ];

    public function cities()
    {
        return $this->hasMany(City::class);
    }
}
