<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Video extends Model
{
    use HasFactory;

    protected $table = 'videos';

    protected $fillable = [
        'title',
        'thumbnail',
        'url',
        'platform',
        'status',
    ];

    /**
     * Relation: Video ke views
     */
    public function views()
    {
        return $this->hasMany(VideoView::class, 'video_id');
    }
}
