<?php

namespace App\Models;

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

class Province extends Model
{
    use HasFactory;

    protected $casts = [
        'name_th' => 'string',
        'name_en' => 'string',
        'country_code' => 'string',
        'code' => 'string',
        'description' => 'string',
        'latitude' => 'float',
        'longitude' => 'float',
        'is_recommended' => 'boolean',
    ];

    protected $hidden = [
        'created_at',
        'updated_at',
    ];

	public function post() {
		return $this->belongsTo(Post::class, "province_id", "id");
	}
}
