working on omis setup
This commit is contained in:
37
app/Models/District.php
Normal file
37
app/Models/District.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user