1.8 KiB
1.8 KiB
Shorts Feature Implementation Plan
Overview
Add "Shorts" as a separate attribute (boolean flag) to identify short-form vertical videos, independent of the video content type (generic/music/match).
✅ Completed Tasks
1. ✅ Database Migration
- Created migration to add
is_shortsboolean column to videos table
2. ✅ Video Model (app/Models/Video.php)
- Added
is_shortsto fillable array - Added
is_shortsto casts (boolean) - Added helper methods:
isShorts(),scopeShorts(),scopeNotShorts() - Added
qualifiesAsShorts()for auto-detection - Added
getFormattedDurationAttribute() - Added
getShortsBadgeAttribute()
3. ✅ Video Controller (app/Http/Controllers/VideoController.php)
- Updated validation to include
is_shorts - Added auto-detection of shorts based on:
- Duration ≤ 60 seconds
- Portrait orientation (height > width)
- Updated store method to include duration and is_shorts
- Updated edit method to include is_shorts in JSON response
- Updated update method to support is_shorts
- Added shorts() method for shorts page
4. ✅ Views
- Added Shorts toggle in upload form (create.blade.php)
- Added Shorts toggle CSS styles
- Added Shorts badge in video cards
- Added Shorts toggle in edit modal
- Created shorts.blade.php page
- Updated sidebar to link to Shorts page
5. ✅ Routes
- Added /shorts route
6. ✅ Admin
- Updated SuperAdminController to support is_shorts
Usage
- Users can mark videos as Shorts during upload
- Shorts are automatically detected if:
- Duration ≤ 60 seconds AND
- Portrait orientation
- Shorts have a red badge on video cards
- Dedicated /shorts page shows all Shorts videos
- Sidebar has a link to Shorts