<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ListingVideo extends Model
{
    /** İlan başına en fazla video (yükleme sınırı). */
    public const MAX_PER_LISTING = 3;

    protected $fillable = [
        'listing_id',
        'file_path',
        'file_url',
        'mime_type',
        'size',
        'duration_seconds',
        'title',
        'sort_order',
    ];

    protected $casts = [
        'size' => 'integer',
        'duration_seconds' => 'integer',
        'sort_order' => 'integer',
    ];

    public function listing()
    {
        return $this->belongsTo(Listing::class);
    }
}
