<?php

namespace Modules\Bms\Entities;

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

class BmsHallMedia extends Model
{
    protected $table = 'bms_hall_media';

    protected $fillable = [
        'business_id', 'hall_id', 'type', 'disk', 'path', 'url',
        'thumbnail_path', 'title', 'event_type', 'is_cover', 'sort_order', 'meta',
    ];

    protected $casts = [
        'is_cover'   => 'boolean',
        'sort_order' => 'integer',
        'meta'       => 'array',
    ];

    public function hall(): BelongsTo
    {
        return $this->belongsTo(BmsHall::class, 'hall_id');
    }
}
