first change
This commit is contained in:
93
Modules/CCMS/app/Models/Blog.php
Normal file
93
Modules/CCMS/app/Models/Blog.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\BlogFactory;
|
||||
|
||||
class Blog extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'short_description',
|
||||
'description',
|
||||
'category_id',
|
||||
'image',
|
||||
'images',
|
||||
'custom',
|
||||
'banner',
|
||||
'views',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'meta_keywords',
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
'date',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class, 'category_id');
|
||||
}
|
||||
}
|
89
Modules/CCMS/app/Models/Branch.php
Normal file
89
Modules/CCMS/app/Models/Branch.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\BranchFactory;
|
||||
|
||||
class Branch extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'short_description',
|
||||
'description',
|
||||
'image',
|
||||
'images',
|
||||
'custom',
|
||||
'location',
|
||||
'mobile',
|
||||
'phone',
|
||||
'email',
|
||||
'banner',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'meta_keywords',
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
}
|
24
Modules/CCMS/app/Models/Category.php
Normal file
24
Modules/CCMS/app/Models/Category.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'status',
|
||||
'order',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
}
|
38
Modules/CCMS/app/Models/Counter.php
Normal file
38
Modules/CCMS/app/Models/Counter.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CCMS\Database\Factories\CounterFactory;
|
||||
|
||||
class Counter extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'icon',
|
||||
'image',
|
||||
'counter',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
}
|
99
Modules/CCMS/app/Models/Country.php
Normal file
99
Modules/CCMS/app/Models/Country.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'short_description',
|
||||
'description',
|
||||
'image',
|
||||
'parent_id',
|
||||
'images',
|
||||
'custom',
|
||||
'banner',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'meta_keywords',
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function institutions()
|
||||
{
|
||||
return $this->hasMany(Institution::class, 'country_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(Country::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(Country::class, 'parent_id');
|
||||
}
|
||||
}
|
29
Modules/CCMS/app/Models/Enquiry.php
Normal file
29
Modules/CCMS/app/Models/Enquiry.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\EnquiryFactory;
|
||||
|
||||
class Enquiry extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'mobile',
|
||||
'class',
|
||||
'subject',
|
||||
'address',
|
||||
'score',
|
||||
'qualification',
|
||||
'message',
|
||||
'is_read',
|
||||
];
|
||||
}
|
33
Modules/CCMS/app/Models/Faq.php
Normal file
33
Modules/CCMS/app/Models/Faq.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CCMS\Database\Factories\FaqFactory;
|
||||
|
||||
class Faq extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
'category_id',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
public function category(){
|
||||
return $this->belongsTo(FaqCategory::class, 'category_id');
|
||||
}
|
||||
}
|
30
Modules/CCMS/app/Models/FaqCategory.php
Normal file
30
Modules/CCMS/app/Models/FaqCategory.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CCMS\Database\Factories\FaqCategoryFactory;
|
||||
|
||||
class FaqCategory extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'status',
|
||||
'order',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
public function faqs()
|
||||
{
|
||||
return $this->hasMany(Faq::class, 'category_id');
|
||||
}
|
||||
}
|
49
Modules/CCMS/app/Models/Gallery.php
Normal file
49
Modules/CCMS/app/Models/Gallery.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\GalleryFactory;
|
||||
|
||||
class Gallery extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'link',
|
||||
'images',
|
||||
'category_id',
|
||||
'status',
|
||||
'order',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(GalleryCategory::class, 'category_id');
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
29
Modules/CCMS/app/Models/GalleryCategory.php
Normal file
29
Modules/CCMS/app/Models/GalleryCategory.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GalleryCategory extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'status',
|
||||
'order',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
public function galleries()
|
||||
{
|
||||
return $this->hasMany(Gallery::class, 'category_id');
|
||||
}
|
||||
}
|
43
Modules/CCMS/app/Models/Institution.php
Normal file
43
Modules/CCMS/app/Models/Institution.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CCMS\Database\Factories\InstutionFactory;
|
||||
|
||||
class Institution extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'link',
|
||||
'image',
|
||||
'country_id',
|
||||
'location',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function country(){
|
||||
return $this->belongsTo(Country::class, 'country_id');
|
||||
}
|
||||
}
|
121
Modules/CCMS/app/Models/Page.php
Normal file
121
Modules/CCMS/app/Models/Page.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\PageFactory;
|
||||
|
||||
class Page extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'section',
|
||||
'template',
|
||||
'type',
|
||||
'description',
|
||||
'short_description',
|
||||
'image',
|
||||
'images',
|
||||
'banner',
|
||||
'custom',
|
||||
|
||||
'link',
|
||||
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
|
||||
'meta_title',
|
||||
'meta_keywords',
|
||||
'meta_description',
|
||||
|
||||
'date',
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'section' => 'array',
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Page::class,
|
||||
'page_relationship',
|
||||
'parent_page_id',
|
||||
'child_page_id',
|
||||
'id',
|
||||
'id'
|
||||
);
|
||||
}
|
||||
|
||||
public function parents()
|
||||
{
|
||||
return $this->belongsToMany(
|
||||
Page::class,
|
||||
'page_relationship',
|
||||
'child_page_id',
|
||||
'parent_page_id',
|
||||
'id',
|
||||
'id'
|
||||
);
|
||||
}
|
||||
}
|
38
Modules/CCMS/app/Models/Partner.php
Normal file
38
Modules/CCMS/app/Models/Partner.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\PartnerFactory;
|
||||
|
||||
class Partner extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'link',
|
||||
'image',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
}
|
49
Modules/CCMS/app/Models/Popup.php
Normal file
49
Modules/CCMS/app/Models/Popup.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CCMS\Database\Factories\PopupFactory;
|
||||
|
||||
class Popup extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
|
||||
'images',
|
||||
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
0
Modules/CCMS/app/Models/Scopes/.gitkeep
Normal file
0
Modules/CCMS/app/Models/Scopes/.gitkeep
Normal file
103
Modules/CCMS/app/Models/Service.php
Normal file
103
Modules/CCMS/app/Models/Service.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
|
||||
class Service extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'short_description',
|
||||
'description',
|
||||
'parent_id',
|
||||
'icon_class',
|
||||
'icon_image',
|
||||
'image',
|
||||
'images',
|
||||
'custom',
|
||||
'banner',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'meta_keywords',
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function iconImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(Service::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(Service::class, 'parent_id');
|
||||
}
|
||||
}
|
23
Modules/CCMS/app/Models/Setting.php
Normal file
23
Modules/CCMS/app/Models/Setting.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\SettingFactory;
|
||||
|
||||
class Setting extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'key',
|
||||
'value',
|
||||
];
|
||||
}
|
48
Modules/CCMS/app/Models/Slider.php
Normal file
48
Modules/CCMS/app/Models/Slider.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Slider extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
|
||||
'images',
|
||||
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
56
Modules/CCMS/app/Models/Team.php
Normal file
56
Modules/CCMS/app/Models/Team.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\TeamFactory;
|
||||
|
||||
class Team extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
|
||||
'designation',
|
||||
'branch_id',
|
||||
'degree',
|
||||
|
||||
'address',
|
||||
'email',
|
||||
'mobile',
|
||||
'image',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
|
||||
'facebook',
|
||||
'twitter',
|
||||
'linkedin',
|
||||
'youtube',
|
||||
'whatsapp',
|
||||
];
|
||||
|
||||
public function branch(){
|
||||
return $this->belongsTo(Branch::class, 'branch_id');
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
}
|
95
Modules/CCMS/app/Models/Test.php
Normal file
95
Modules/CCMS/app/Models/Test.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\CCMS\Traits\UpdateCustomFields;
|
||||
// use Modules\CCMS\Database\Factories\TestFactory;
|
||||
|
||||
class Test extends Model
|
||||
{
|
||||
use HasFactory, UpdateCustomFields, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'short_description',
|
||||
'description',
|
||||
'image',
|
||||
'images',
|
||||
'custom',
|
||||
'banner',
|
||||
'parent_id',
|
||||
'meta_title',
|
||||
'meta_description',
|
||||
'meta_keywords',
|
||||
'sidebar_title',
|
||||
'sidebar_content',
|
||||
'sidebar_image',
|
||||
'button_text',
|
||||
'button_url',
|
||||
'button_target',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'custom' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
protected function images(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function ($value) {
|
||||
if (empty($value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$parts = explode(',', $value);
|
||||
return array_map(fn($part) => asset(trim($part)), $parts);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function banner(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
protected function sidebarImage(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(Test::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(Test::class, 'parent_id');
|
||||
}
|
||||
}
|
43
Modules/CCMS/app/Models/Testimonial.php
Normal file
43
Modules/CCMS/app/Models/Testimonial.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CCMS\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CCMS\Database\Factories\TestimonialFactory;
|
||||
|
||||
class Testimonial extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
'designation',
|
||||
'company',
|
||||
'image',
|
||||
'branch_id',
|
||||
'status',
|
||||
'order',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function branch(){
|
||||
return $this->belongsTo(Branch::class, 'branch_id');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user