<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class PlayerRecordMedia extends Model
{
    protected $fillable = [
        'player_record_id',
        'file_path',
        'thumbnail_path',
        'original_name',
        'mime_type',
        'size',
        'checksum',
        'caption',
        'sort_order',
    ];

    protected function casts(): array
    {
        return [
            'size' => 'integer',
            'sort_order' => 'integer',
        ];
    }

    public function playerRecord(): BelongsTo
    {
        return $this->belongsTo(PlayerRecord::class);
    }
}
