<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Broadcast extends Model
{
    protected $fillable = [
        'created_by_admin_id',
        'title',
        'body',
        'image_path',
        'pdf_path',
        'target',
        'event_id',
        'sent_at',
    ];

    protected $casts = [
        'sent_at' => 'datetime',
    ];

    public function event()
    {
        return $this->belongsTo(Event::class);
    }

    public function reads()
    {
        return $this->hasMany(BroadcastRead::class);
    }
}
