2024-04-05 05:22:15 +00:00
|
|
|
<?php
|
|
|
|
|
2024-04-07 12:14:05 +00:00
|
|
|
namespace App\Models;
|
2024-04-05 05:22:15 +00:00
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class District extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
|
|
'district_name',
|
|
|
|
'country_id',
|
|
|
|
'province_id',
|
|
|
|
'status',
|
|
|
|
];
|
|
|
|
|
|
|
|
public static function getDistricts()
|
|
|
|
{
|
|
|
|
return self::select('id', 'district_name')->where('status', 'Active')->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getDistrictsByProvinceId($province_id)
|
|
|
|
{
|
|
|
|
return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getPermDistrictsByProvinceId($province_id)
|
|
|
|
{
|
|
|
|
return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getTempDistrictsByProvinceId($province_id)
|
|
|
|
{
|
|
|
|
return self::select('id', 'district_name')->where('status', 'Active')->where('state_id',$province_id)->get();
|
|
|
|
}
|
|
|
|
}
|