first commit

This commit is contained in:
2025-07-07 18:01:52 +05:45
commit 71241f5167
2095 changed files with 112735 additions and 0 deletions

60
app/Models/!Contacts.php Normal file
View File

@ -0,0 +1,60 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Contacts extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'contact_id';
public $timestamps = true;
protected $fillable =[
'forms_id',
'name',
'tagline',
'address',
'tel',
'fax',
'email1',
'email2',
'website',
'google_map',
'facebook',
'hp1',
'hp2',
'display_order',
'status',
'remarks',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Accridiations extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'accridiation_id';
public $timestamps = true;
protected $fillable =[
'display',
'title',
'text',
'image',
'thumb',
'cover',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

74
app/Models/Articles.php Normal file
View File

@ -0,0 +1,74 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Articles extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'article_id';
public $timestamps = true;
protected $fillable = [
'parent_article',
'title',
'subtitle',
'alias',
'description',
'additional_description',
'cover_photo',
'thumb',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted(): void{
static::AddGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
public function parent()
{
return $this->belongsTo(Articles::class, 'parent_article')->where('status', 1);
}
public function children()
{
return $this->hasMany(Articles::class, 'parent_article')->where('status', 1);
}
}

66
app/Models/Blogs.php Normal file
View File

@ -0,0 +1,66 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use Illuminate\Database\Eloquent\Attributes\ScopedBy;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Blogs extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'blog_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'text',
'image',
'thumb',
'cover',
'display_order',
'status',
'createdby',
'updatedby',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'created_at',
'updated_at',
];
protected $casts = [
'created_at' => 'datetime',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted() :void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,58 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Brancharticles extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'article_id';
public $timestamps = true;
protected $fillable =[
'branches_id',
'parent_article',
'title',
'alias',
'text',
'description',
'thumb',
'cover_photo',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

64
app/Models/Branches.php Normal file
View File

@ -0,0 +1,64 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Branches extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'branch_id';
public $timestamps = true;
protected $fillable =[
'parent_branch',
'title',
'alias',
'contact_person',
'designation',
'text',
'cover_photo',
'thumb',
'description',
'contact1',
'contact2',
'email',
'address',
'google_map',
'display_order',
'status',
'seo_keywords',
'seo_title',
'seo_description',
'og_tags',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Certificates extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'certificate_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'photo',
'thumb',
'text',
'description',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

61
app/Models/Contacts.php Normal file
View File

@ -0,0 +1,61 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Contacts extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'contact_id';
public $timestamps = true;
protected $fillable = [
'forms_id',
'branches_id',
'name',
'tagline',
'address',
'tel',
'fax',
'email1',
'email2',
'website',
'google_map',
'facebook',
'hp1',
'hp2',
'display_order',
'status',
'remarks',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

70
app/Models/Countries.php Normal file
View File

@ -0,0 +1,70 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Countries extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'country_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'text',
'details',
'cover_photo',
'images',
'image_thumb',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
public function articles(){
return $this->hasMany(Countryarticles::class,'countries_id');
}
public function institutions(){
return $this->hasMany(Institutions::class,'countries_id');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Countryarticles extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'article_id';
public $timestamps = true;
protected $fillable =[
'countries_id',
'parent_article',
'title',
'alias',
'text',
'cover_photo',
'thumb',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Customfields extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'customfield_id';
public $timestamps = true;
protected $fillable =[
'customfield_for',
'customfield_forref',
'title',
'alias',
'text',
'link',
'fa_icon',
'logo',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

27
app/Models/Enquiries.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Enquiries extends Model
{
use HasFactory;
protected $primaryKey = 'enquiry_id';
public $timestamps = true;
protected $fillable = [
'name',
'phone',
'email',
'is_read',
'message',
'service_id',
];
public function service()
{
return $this->belongsTo(Services::class, 'service_id', 'service_id');
}
}

60
app/Models/Events.php Normal file
View File

@ -0,0 +1,60 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Events extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'event_id';
public $timestamps = true;
protected $fillable =[
'startdate',
'enddate',
'title',
'alias',
'text',
'description',
'image',
'thumb',
'cover',
'link',
'seo_title',
'seo_description',
'seo_keywords',
'og_tags',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

52
app/Models/Faqs.php Normal file
View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Faqs extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'faq_id';
public $timestamps = true;
protected $fillable = [
'title',
'text',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
public static function booted():void{
static::AddGlobalScope(new ActiveScope);
}
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

61
app/Models/Features.php Normal file
View File

@ -0,0 +1,61 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Features extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'feature_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'number',
'icon',
'thumb',
'remarks',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $casts = [
'number' =>'integer',
];
protected static function booted() :void{
static::addGlobalScope(new ActiveScope);
}
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

63
app/Models/Forms.php Normal file
View File

@ -0,0 +1,63 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Forms extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'form_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'cover_photo',
'image_thumb',
'form_fields',
'text',
'headers',
'toemail',
'fromemail',
'emailsubject',
'emailtext',
'autoresponse',
'responseheaders',
'responsefrom',
'responsesubject',
'responsetext',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Formsubmissions extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'formsubmission_id';
public $timestamps = true;
protected $fillable = [
'forms_id',
'submitted_values',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

57
app/Models/Galleries.php Normal file
View File

@ -0,0 +1,57 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Galleries extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'gallery_id';
public $timestamps = true;
protected $fillable = [
'title',
'text',
'alias',
'thumb',
'images',
'cover_photo',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
public static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Institutions extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'institution_id';
public $timestamps = true;
protected $fillable = [
'countries_id',
'title',
'alias',
'email',
'text',
'logo',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace App\Models\Log;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ActivityLog extends Model
{
use HasFactory;
protected $primaryKey = 'activity_id';
public $timestamps = true;
protected $fillable = [
'user_id',
'controllerName',
'methodName',
'actionUrl',
'activity',
'created_at',
'updated_at',
];
protected $appends = ['user_name'];
public function getUserNameAttribute()
{
$user = User::find($this->user_id);
return $user ? $user->name : '';
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Models\Log;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ErrorLog extends Model
{
use HasFactory;
protected $primaryKey = 'id';
public $timestamps = true;
protected $fillable = [
'user_id',
'controller_name',
'method_name',
'errors',
'created_at',
'updated_at',
];
protected $appends = [];
}

View File

@ -0,0 +1,37 @@
<?php
namespace App\Models\Log;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class LoginLog extends Model
{
use HasFactory;
protected $primaryKey = 'login_id';
public $timestamps = true;
protected $fillable = [
'user_id',
'ip',
'user_agent',
'type',
'login_at',
'logout_at',
'created_at',
'updated_at',
];
protected $appends = ['user_name'];
public function getUserNameAttribute()
{
$user = User::find($this->user_id);
return $user ? $user->name : '';
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Models\Log;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class OperationLog extends Model
{
use HasFactory;
protected $primaryKey = 'operation_id';
public $timestamps = true;
protected $fillable = [
'refNo',
'user_id',
'operation_start_no',
'operation_end_no',
'model_name',
'model_id',
'operation_name',
'previous_values',
'new_values',
'created_at',
'updated_at',
];
// protected $appends = ['operation_by'];
// public function getOperationByAttribute()
// {
// $user = User::find($this->user_id);
// return $user ? $user->name : '';
// }
}

61
app/Models/Menuitems.php Normal file
View File

@ -0,0 +1,61 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Menuitems extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'menu_id';
public $timestamps = true;
protected $fillable = [
'parent_menu',
'menulocations_id',
'title',
'alias',
'type',
'ref',
'target',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
public function parent(){
return $this->belongsTo(Menuitems::class, 'parent_menu')->where('status',1);
}
public function children(){
return $this->hasMany(Menuitems::class, 'parent_menu')->where('status',1);
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Menulocations extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'menulocation_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

52
app/Models/Milestones.php Normal file
View File

@ -0,0 +1,52 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Milestones extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'milestone_id';
public $timestamps = true;
protected $fillable =[
'display',
'title',
'text',
'image',
'thumb',
'cover',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

57
app/Models/News.php Normal file
View File

@ -0,0 +1,57 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class News extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'news_id';
public $timestamps = true;
protected $fillable =[
'parent_news',
'title',
'alias',
'text',
'image',
'thumb',
'cover',
'display_order',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

50
app/Models/Photos.php Normal file
View File

@ -0,0 +1,50 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Photos extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'photo_id';
public $timestamps = true;
protected $fillable =[
'galleries_id',
'title',
'alias',
'thumb',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

53
app/Models/Popups.php Normal file
View File

@ -0,0 +1,53 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Popups extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'popup_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'text',
'btn_label',
'btn_link',
'end_date',
'photo',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,84 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Preparationclasses extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'preparationclass_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'parent_preparationclass',
'description',
'additional_description',
'intro',
'image',
'thumb',
'cover',
'remarks',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
public function parent()
{
return $this->belongsTo(Preparationclasses::class, 'parent_preparationclass');
}
public function children()
{
return $this->hasMany(Preparationclasses::class, 'parent_preparationclass')
->where('status', 1)
->orderBy('display_order', 'asc');
}
public function offerClasses()
{
return $this->hasMany(Preparationclassoffers::class, 'preparationclasses_id')
->where('status', 1);
}
public function testimonials()
{
return $this->hasMany(Preparationclasstestimonials::class, 'preparationclasses_id')
->where('status', 1);
}
}

View File

@ -0,0 +1,64 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Preparationclassoffers extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'preparationclassoffer_id';
public $timestamps = true;
protected $fillable = [
'preparationclasses_id',
'title',
'alias',
'classtime',
'details',
'intro',
'image',
'thumb',
'cover',
'remarks',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $casts = [
'classtime' => 'datetime',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Preparationclasstestimonials extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'testimonial_id';
public $timestamps = true;
protected $fillable =[
'preparationclasses_id',
'name',
'rating',
'student',
'message',
'thumb',
'remarks',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

60
app/Models/Programs.php Normal file
View File

@ -0,0 +1,60 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Programs extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'program_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'countries_id',
'details',
'required_documents',
'qualification',
'image',
'thumb',
'cover',
'remarks',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

50
app/Models/Quicklinks.php Normal file
View File

@ -0,0 +1,50 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Quicklinks extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'quicklink_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'thumb',
'link',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

58
app/Models/Resources.php Normal file
View File

@ -0,0 +1,58 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Resources extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'resource_id';
public $timestamps = true;
protected $fillable =[
'resourcetypes_id',
'parent_resource',
'title',
'alias',
'text',
'link',
'cover_photo',
'thumb',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Resourcetypes extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'resourcetype_id';
public $timestamps = true;
protected $fillable =[
'parent_resourcetype',
'title',
'alias',
'text',
'cover_photo',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Models\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class ActiveScope implements Scope
{
/**
* Apply the scope to a given Eloquent query builder.
*/
public function apply(Builder $builder, Model $model): void
{
$builder->where("status", 1);
}
}

60
app/Models/Services.php Normal file
View File

@ -0,0 +1,60 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Services extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'service_id';
public $timestamps = true;
protected $fillable =[
'parent_service',
'title',
'alias',
'text',
'link',
'cover_photo',
'display_order',
'status',
'created_at',
'updated_at',
'seo_keywords',
'seo_title',
'seo_descriptions',
'og_tags',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

75
app/Models/Settings.php Normal file
View File

@ -0,0 +1,75 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Settings extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'setting_id';
public $timestamps = true;
protected $fillable = [
'title',
'description',
'url1',
'url2',
'email',
'phone',
'secondary_phone',
'google_map',
'fb',
'insta',
'twitter',
'tiktok',
'primary_logo',
'secondary_logo',
'thumb',
'icon',
'og_image',
'no_image',
'copyright_text',
'content1',
'content2',
'content3',
'seo_title',
'seo_description',
'seo_keywords',
'og_tags',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
'recaptcha_secret_key',
'recaptcha_site_key'
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

50
app/Models/Shortcodes.php Normal file
View File

@ -0,0 +1,50 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Shortcodes extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'shortcode_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'text',
'description',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

53
app/Models/Sitemenus.php Normal file
View File

@ -0,0 +1,53 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Sitemenus extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'menu_id';
public $timestamps = true;
protected $fillable =[
'parent_menu',
'menulocations_id',
'title',
'alias',
'type',
'ref',
'target',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

51
app/Models/Sliders.php Normal file
View File

@ -0,0 +1,51 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Sliders extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'slider_id';
public $timestamps = true;
protected $fillable = [
'slider_title',
'slider_desc',
'url1',
'url2',
'thumb',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Subscribers extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'subscriber_id';
public $timestamps = true;
protected $fillable =[
'title',
'alias',
'email',
'display_order',
'status',
'createdby',
'updatedby',
'created_at',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Successstories extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'successstory_id';
public $timestamps = true;
protected $fillable =[
'countries_id',
'title',
'alias',
'image',
'text',
'remarks',
'display_order',
'status',
'university',
'faculty',
'createdby',
'created_at',
'updatedby',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

54
app/Models/Teams.php Normal file
View File

@ -0,0 +1,54 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Teams extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'team_id';
public $timestamps = true;
protected $fillable =[
// 'branches_id',
'title',
'alias',
'photo',
'thumb',
'designation',
'role',
'description',
'display_order',
'status',
'created_at',
'updated_at',
'createdby',
'updatedby',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace App\Models;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Testimonials extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'testimonial_id';
public $timestamps = true;
protected $fillable = [
'branches_id',
'by',
'alias',
'rating',
'image',
'cover',
'text',
'remarks',
'display_order',
'status',
'testimonials_faculty',
'testimonials_university',
'university',
'faculty',
'createdby',
'created_at',
'updatedby',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

47
app/Models/User.php Normal file
View File

@ -0,0 +1,47 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'username',
'is_admin',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Models;
use App\Models\Scopes\ActiveScope;
use App\Models\User;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Visagrantposts extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'visagrantpost_id';
public $timestamps = true;
protected $fillable = [
'title',
'alias',
'image',
'display_type',
'remarks',
'display_order',
'status',
'createdby',
'created_at',
'updatedby',
'updated_at',
];
protected $appends = ['status_name'];
public static function booted():void{
static::addGlobalScope(new ActiveScope);
}
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn($value) => User::find($value) ? User::find($value)->name : '',
);
}
}

59
app/Models/Visas.php Normal file
View File

@ -0,0 +1,59 @@
<?php
namespace App\Models;
use App\Models\User;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\CreatedUpdatedBy;
class Visas extends Model
{
use HasFactory, CreatedUpdatedBy;
protected $primaryKey = 'visa_id';
public $timestamps = true;
protected $fillable = [
'branches_id',
'for',
'ref',
'title',
'alias',
'image',
'cover',
'description',
'text',
'university',
'faculty',
'remarks',
'display_order',
'status',
'createdby',
'created_at',
'updatedby',
'updated_at',
];
protected $appends = ['status_name'];
protected function getStatusNameAttribute()
{
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
}
protected function createdBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
protected function updatedBy(): Attribute
{
return Attribute::make(
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
);
}
}