Overview
TheSeries model represents TV series in the application. It uses Laravel Scout for full-text search and integrates with Spatie Laravel Data for type-safe DTOs.
Model Path: app/Models/Series.phpTable:
seriesPrimary Key:
series_id (non-incrementing)
Database Schema
Primary key for the series
Unique series number
Name of the series
URL to the series cover image
Series plot/description
Cast members of the series
Director of the series
Genre classification
Release date of the series
Last modification timestamp (immutable)
Rating value
Rating on a 5-point scale (precision: 3,1)
JSON array of backdrop image paths
YouTube trailer URL or ID
Episode runtime information
Category identifier
Record creation timestamp
Record last update timestamp
Fillable Attributes
All fields are mass assignable via the fillable array:Type Casts
The model casts the following attributes:series_id→integerrating_5based→decimal:1backdrop_path→AsArrayObjectlast_modified→immutable_datetime
Relationships
Watchlists
Polymorphic one-to-many relationship with the Watchlist model.Search
The Series model uses Laravel Scout for full-text search. The following fields are indexed:nameplotcastdirectorgenre
Data Transfer Object
The model integrates withSeriesData DTO class via the WithData trait: