<?php

namespace App\Models\System\Settings\Location;

use App\Models\Post\PostBranch;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Spatie\Translatable\HasTranslations;

class Province extends Model
{
    use HasFactory;
    use HasTranslations;

    /**
     * The attributes that are mass assignable.
     *
     * @var array<int, string>
     */
    protected $fillable = [
        'region',
        'name',
    ];

    /**
     * Translatable fields
     *
     * @var array<string>
     */
    public $translatable = ['name'];

    /**
     * Post branches
     */
    public function postBranches(): HasMany
    {
        return $this->hasMany(PostBranch::class);
    }
}
