35 lines
780 B
PHP
35 lines
780 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use App\Models\ProjectMosaic;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ProjectMosaicStatus implements ShouldBroadcastNow
|
|
{
|
|
use SerializesModels;
|
|
|
|
public ProjectMosaic $projectMosaic;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*/
|
|
public function __construct(ProjectMosaic $projectMosaic)
|
|
{
|
|
//
|
|
$this->projectMosaic = $projectMosaic;
|
|
}
|
|
|
|
/**
|
|
* Get the channels the event should broadcast on.
|
|
*
|
|
* @return array<int, \Illuminate\Broadcasting\Channel>
|
|
*/
|
|
public function broadcastOn(): array
|
|
{
|
|
return [new PrivateChannel('mosaic.'.$this->projectMosaic->id)];
|
|
}
|
|
}
|