SmartCane/laravel_app/app/Events/ProjectDownloadStatus.php
guillaume91 cf5e2fea70 wip
2024-06-24 16:41:24 +02:00

35 lines
751 B
PHP

<?php
namespace App\Events;
use App\Models\ProjectDownload;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Queue\SerializesModels;
class ProjectDownloadStatus implements ShouldBroadcastNow
{
use SerializesModels;
public ProjectDownload $projectDownload;
/**
* Create a new event instance.
*/
public function __construct($projectDownload)
{
$this->projectDownload = $projectDownload;
}
/**
* Get the channels the event should broadcast on.
*
*/
public function broadcastOn(): Channel
{
return new PrivateChannel('download.'.$this->projectDownload->id);
}
}