SmartCane/laravel_app/app/Events/ProjectReportStatus.php
2024-05-28 16:38:27 +02:00

36 lines
786 B
PHP

<?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)];
}
}