List Watchlist Items
Display all items in the current user’s watchlist with optional filtering by media type.watchlist
Middleware: auth, verified
Controller: WatchlistController::index (app/Http/Controllers/WatchlistController.php:27)
Query Parameters
Filter watchlist by media type
all- Show both movies and series (default)movies- Show only moviesseries- Show only series- Case-insensitive
Response
Returns Inertia response renderingwatchlist component.
Props:
Collection of watchlist items
- Ordered by creation date (latest first)
- Each item includes:
id- Watchlist entry IDtype- Media type (“movie” or “series”)watchableId- Media ID (stream_id or series_id)name- Media titlecover- Cover/poster image URLaddedAt- Human-readable timestamp (e.g., “2 days ago”)
Current active filter
- Returns the applied filter value
Watchlist Item Structure
Movie Items:Filter Logic
Filtering is applied at the database query level:Example
Add to Watchlist
Add a movie or series to the current user’s watchlist.watchlist.store
Middleware: auth, verified
Controller: WatchlistController::store (app/Http/Controllers/WatchlistController.php:70)
Request Body
Media type to add
movie- Add a movieseries- Add a series- Case-insensitive
- Validated via
StoreWatchlistRequest
Media ID
- For movies: stream_id from VodStream
- For series: series_id from Series
- Must be valid integer
Response
Redirects to watchlist page. Success:- Silently adds item to watchlist
- Redirects to
watchlistroute
Model Type Resolution
The controller maps request type to Laravel model:Duplicate Prevention
TheAddToWatchlist action handles duplicate checking:
- Returns
falseif item already in watchlist - Returns
trueif successfully added
Example
Remove from Watchlist
Remove an item from the current user’s watchlist.watchlist.destroy
Middleware: auth, verified
Controller: WatchlistController::destroy (app/Http/Controllers/WatchlistController.php:91)
Path Parameters
Watchlist entry ID
- Must be numeric (validated with
whereNumber) - Must exist in user’s watchlist
Response
Redirects to watchlist page. Success:Security
The query usesfirstOrFail() which ensures:
- Only authenticated user’s watchlist items can be deleted
- Throws
ModelNotFoundExceptionif ID is invalid or belongs to another user
Example
Alternative Watchlist Endpoints
In addition to the main watchlist controller, media-specific endpoints exist for quick add/remove operations:Movie-Specific Endpoints
Add Movie:Series-Specific Endpoints
Add Series:Watchlist Model
Watchlist items are stored in theWatchlist model:
Key Fields:
id- Primary keyuser_id- Owner user IDwatchable_type- Polymorphic type (VodStream::class or Series::class)watchable_id- Media ID (stream_id or series_id)created_at- When item was addedupdated_at- Last modification
Watchlist Checking
Controllers use theinMyWatchlist helper method on the User model:
- VodStreamController.php:137
- SeriesController.php:156
Watchlist Existence Query
List queries includein_watchlist flag using withExists:
- VodStreamController.php:45-47
- SeriesController.php:41-43
Shared Watchlist Actions
Two actions handle watchlist operations across the application:AddToWatchlist Action
true- Successfully addedfalse- Already exists or error
- WatchlistController.php:78
- VodStreamWatchlistController.php:22
- SeriesWatchlistController.php:22
RemoveFromWatchlist Action
true- Successfully removedfalse- Not found or error
- VodStreamWatchlistController.php:35
- SeriesWatchlistController.php:35
User Scope
All watchlist operations are scoped to the authenticated user: Listing:Next Steps
Movies API
Learn about movie-specific watchlist endpoints
Series API
Learn about series-specific watchlist endpoints
Authentication
Understand user authentication and scoping