<?php

namespace App\Models;

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

class Province extends Model
{
    use HasFactory;

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

    public function agencies()
    {
        return $this->hasMany(Agency::class, 'pro_id', 'pro_id')->where('grade', 'P');
    }
}
