module updated

This commit is contained in:
2024-04-10 15:21:30 +05:45
parent c1a81191fa
commit 3267e212f7
71 changed files with 1390 additions and 1812 deletions

16
app/Models/Cities.php Normal file
View 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
View 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 = [];
}

View 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 = [];
}

View 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 = [];
}

View File

@ -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
View 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',
];
}

View File

@ -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();
}
}