<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Swindon\FilamentHashids\Traits\HasHashid;

class AnnouncementMedia extends Model
{
    use HasFactory, HasHashid;

    protected $guarded = ['id'];

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

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

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