<?php

namespace App\Events;

use App\Models\ProjectReport;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;

class ProjectReportStatus implements ShouldBroadcast
{
    use SerializesModels;

    public ProjectReport $projectReport;

    /**
     * Create a new event instance.
     */
    public function __construct(ProjectReport $projectReport)
    {
        //
        $this->projectReport = $projectReport;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return array<int, Channel>
     */
    public function broadcastOn(): array
    {
        return [new PrivateChannel('report.'.$this->projectReport->id)];
    }
}
