mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-14 09:01:42 -04:00
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\StudioPlus\Events;
|
|
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Modules\StudioPlus\Transformers\WatermarkingJobResource;
|
|
|
|
/**
|
|
* Class UserEvent
|
|
*/
|
|
class UpdateJobStatusEvent implements ShouldBroadcast
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param array $data
|
|
* @param int|array $userIds
|
|
*/
|
|
public function __construct(protected $job)
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|PrivateChannel
|
|
*/
|
|
public function broadcastOn()
|
|
{
|
|
return new Channel('watermarking');
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function broadcastWith()
|
|
{
|
|
return [
|
|
'type' => 'UpdateJobStatusEvent',
|
|
'job' => WatermarkingJobResource::make($this->job->load('video'))
|
|
];
|
|
}
|
|
}
|