module updated
This commit is contained in:
16
app/Models/Cities.php
Normal file
16
app/Models/Cities.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Cities extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_citites';
|
||||
protected $primaryKey = 'city_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
17
app/Models/Companies.php
Normal file
17
app/Models/Companies.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Companies extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_companies';
|
||||
|
||||
protected $primaryKey = 'company_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
16
app/Models/Departments.php
Normal file
16
app/Models/Departments.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Departments extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_departments';
|
||||
protected $primaryKey = 'department_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
16
app/Models/Designations.php
Normal file
16
app/Models/Designations.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Designations extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_designations';
|
||||
protected $primaryKey = 'designation_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
20
app/Models/Districts.php
Normal file
20
app/Models/Districts.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Districts extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_districts';
|
||||
protected $primaryKey = 'district_id';
|
||||
protected $fillable = [
|
||||
'district_name',
|
||||
'countries_id',
|
||||
'provinces_id',
|
||||
'status',
|
||||
];
|
||||
}
|
@ -8,6 +8,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Province extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_provinces';
|
||||
protected $primaryKey = 'province_id';
|
||||
protected $fillable = [
|
||||
'province_name',
|
||||
'country_id',
|
||||
@ -17,14 +20,4 @@ class Province extends Model
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
|
||||
public static function getProvinces()
|
||||
{
|
||||
return self::select('id','province_name')->where('status','Active')->get();
|
||||
}
|
||||
|
||||
public static function getProvincesByCountryId($country_id)
|
||||
{
|
||||
return self::select('id','province_name')->where('status','Active')->where('country_id',$country_id)->get();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user