New-OMIS/app/Models/District/District.php

38 lines
1.0 KiB
PHP
Raw Normal View History

2024-04-05 05:22:15 +00:00
<?php
namespace App\Modules\Models\District;
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();
}
}