Skip to main content

Overview

The VodStream model represents video-on-demand (VOD) content in the application. It uses Laravel Scout for search functionality and integrates with Spatie Laravel Data. Model Path: app/Models/VodStream.php
Table: vod_streams
Primary Key: stream_id (non-incrementing)

Database Schema

stream_id
integer
required
Primary key for the VOD stream
num
integer
required
Unique stream number
name
string
required
Name of the VOD content
stream_type
string
required
Type of the stream
stream_icon
string
URL to the stream icon/thumbnail
rating
string
Rating value
rating_5based
decimal
default:"0"
Rating on a 5-point scale (precision: 3,1)
added
datetime
required
Timestamp when the stream was added (immutable)
is_adult
boolean
default:"false"
Whether the content is adult/mature content
category_id
string
Category identifier
container_extension
string
required
File container extension (e.g., ‘mp4’, ‘mkv’)
custom_sid
string
Custom stream identifier
direct_source
string
Direct source URL or reference
created_at
timestamp
Record creation timestamp
updated_at
timestamp
Record last update timestamp

Fillable Attributes

The following fields are mass assignable:
[
    'name',
    'stream_type',
    'stream_id',
    'stream_icon',
    'rating',
    'rating_5based',
    'added',
    'is_adult',
    'category_id',
    'container_extension',
    'custom_sid',
    'direct_source',
]

Type Casts

The model casts the following attributes:
  • stream_idinteger
  • rating_5baseddecimal:1
  • is_adultboolean
  • addedimmutable_datetime

Relationships

Watchlists

Polymorphic one-to-many relationship with the Watchlist model.
public function watchlists(): MorphMany
Returns all watchlist entries for this VOD stream. Usage:
$vod = VodStream::find(123);
$watchlists = $vod->watchlists;
The VodStream model uses Laravel Scout for full-text search. Only the name field is indexed. Example:
$results = VodStream::search('Inception')->get();

Data Transfer Object

The model integrates with VodStreamData DTO class:
protected $dataClass = VodStreamData::class;

Adult Content Filtering

Use the is_adult flag to filter mature content:
// Get non-adult content only
$familyFriendly = VodStream::where('is_adult', false)->get();

// Get adult content
$matureContent = VodStream::where('is_adult', true)->get();

Build docs developers (and LLMs) love