Category model represents content categories synced from your IPTV provider. Categories help organize movies and TV series for easier browsing.
Model Location
Database Schema
The categories table stores category information from your IPTV provider.Primary key
Unique identifier from the IPTV provider
- Must be unique across all categories
- Used for syncing with provider’s category structure
Display name of the category
Whether this category contains VOD/movie content
- Indexed for performance
- Used to filter categories in movie browsing
Whether this category contains TV series content
- Indexed for performance
- Used to filter categories in series browsing
Whether this is a system-managed category
- System categories cannot be deleted
- Includes “Uncategorized” categories
When the category was first created
When the category was last updated
Fillable Attributes
Type Casts
System Categories
Two special system categories are created automatically:Uncategorized VOD
- Provider ID:
__uncategorized_vod__ - Name: Uncategorized
- In VOD:
true - In Series:
false - Is System:
true
Uncategorized Series
- Provider ID:
__uncategorized_series__ - Name: Uncategorized
- In VOD:
false - In Series:
true - Is System:
true
Usage Examples
Query VOD Categories
Query Series Categories
Check System Categories
Database Indexes
The categories table has indexes on:provider_id(unique) - Fast lookups by provider identifierin_vod- Efficient filtering of VOD categoriesin_series- Efficient filtering of series categories
Relationships
Categories are referenced by VOD streams and Series through thecategory_provider_id field, but do not have explicit Eloquent relationships defined. The relationship is maintained at the application level through provider IDs.
Synchronization
Categories are synced from your IPTV provider using theSyncCategories action:
Category Sync Process
Categories are separate for VOD and Series content. A category can exist in both (e.g., “Action” movies and “Action” TV shows) or be specific to one content type.
Validation Rules
When creating or updating categories:provider_idmust be uniquenameis requiredin_vodandin_seriescannot both be false- System categories (
is_system = true) cannot be deleted