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

34 lines
714 B
PHP

<?php
namespace App\Events;
use App\Models\ProjectDownload;
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(): array
{
return [new PrivateChannel('download.'.$this->projectDownload->id)];
}
}