<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class District extends Model
{
    protected $table = 'pd_districts';
    protected $fillable = ['division_id','name','slug','status'];
    protected $casts = ['status'=>'boolean'];

    public function division(){ return $this->belongsTo(Division::class,'division_id'); }
    public function upazilas(){ return $this->hasMany(Upazila::class,'district_id'); }
    public function scopeActive($q){ return $q->where('status',1); }
}