firstcommit

This commit is contained in:
2024-05-16 09:31:08 +05:45
commit 34d9672cb8
1396 changed files with 86482 additions and 0 deletions

View File

View File

@ -0,0 +1,27 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\CityFactory;
class City extends Model
{
use HasFactory;
protected $table = "tbl_cities";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'district_id',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
}

View File

@ -0,0 +1,29 @@
<?php
namespace Modules\Admin\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\CountryFactory;
class Country extends Model
{
use HasFactory, StatusTrait;
protected $table = "tbl_countries";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected $appends = ['status_name'];
}

View File

@ -0,0 +1,40 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\DistrictFactory;
class District extends Model
{
use HasFactory;
protected $table = "tbl_districts";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'province_id',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected function province(){
return $this->belongsTo(Province::class,'province_id');
}
// protected function name(): Attribute
// {
// return Attribute::make(
// get: fn($value) => strtolower($value),
// );
// }
}

View File

@ -0,0 +1,29 @@
<?php
namespace Modules\Admin\Models;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Str;
class Dropdown extends Model
{
use StatusTrait;
protected $table = 'tbl_dropdowns';
protected $fillable = ['fid', 'title', 'alias', 'status'];
protected $appends = ['status_name'];
protected static function booted()
{
static::creating(function ($field) {
$field->alias = Str::slug($field->title);
});
static::updating(function ($field) {
$field->alias = Str::slug($field->title);
});
}
public function field()
{
return $this->belongsTo(Field::class, 'fid');
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Str;
class Field extends Model
{
protected $table = 'tbl_fields';
protected $fillable = ['title', 'alias', 'status'];
protected static function booted()
{
static::creating(function ($field) {
$field->alias = Str::slug($field->title);
});
static::updating(function ($field) {
$field->alias = Str::slug($field->title);
});
}
public function dropdown()
{
return $this->hasMany(Dropdown::class, 'fid');
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Admin\Database\factories\MunicipalityFactory;
class Municipality extends Model
{
use HasFactory;
protected $table = "tbl_municipalities";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'distict_id',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected function district()
{
return $this->belongsTo(District::class, 'district_id');
}
}

View File

@ -0,0 +1,34 @@
<?php
namespace Modules\Admin\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\Admin\Database\factories\ProvinceFactory;
class Province extends Model
{
use HasFactory;
protected $table = "tbl_provinces";
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'country_id',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected function country()
{
return $this->belongsTo(Country::class, 'country_id');
}
}