PageCategories
extends Model
in package
uses
HasFactory
Page Categories Model
This model manages page categories and content type configurations for the CICMS system. It stores category information, content permissions, SEO settings, and configuration options for different types of page content.
Table of Contents
Properties
- $fillable : array<string|int, string>
- The attributes that are mass assignable.
Methods
- __construct() : void
- Create a new PageCategories model instance.
- getPageCategory() : Collection
- Get page category data by pcm_status.
- getPageCategoryBySlug() : Collection
- Get page category data by pcm_slug.
Properties
$fillable
The attributes that are mass assignable.
protected
array<string|int, string>
$fillable
= ['pcm_title', 'pcm_slug', 'pcm_status', 'allow_doc', 'allow_video', 'allow_date', 'allow_image', 'allow_content', 'seo', 'pcm_alias', 'created_by', 'updated_by', 'created_at', 'updated_at']
Methods
__construct()
Create a new PageCategories model instance.
public
__construct() : void
Sets the table name from configuration constants.
getPageCategory()
Get page category data by pcm_status.
public
getPageCategory() : Collection
This function is used to get page category data by pcm_status. Retrieves active categories with SEO enabled, ordered by slug.
Return values
Collection —Collection of active SEO-enabled page categories
getPageCategoryBySlug()
Get page category data by pcm_slug.
public
getPageCategoryBySlug(string $pcm_slug) : Collection
This function is used to get page category data by pcm_slug.
Parameters
- $pcm_slug : string
-
The page category slug
Return values
Collection —Collection of matching page categories