<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

final class Country extends Model
{
    protected $fillable = [
        'code',
        'name',
        'has_states',
    ];

    protected function casts(): array
    {
        return [
            'has_states' => 'boolean',
            'created_at' => 'datetime',
            'updated_at' => 'datetime',
        ];
    }

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