mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
48 lines
981 B
PHP
48 lines
981 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* Class UpdatesEvent
|
|
*/
|
|
class UpdatesEvent implements ShouldBroadcast
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
public $user;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @param array $user
|
|
*/
|
|
public function __construct($user)
|
|
{
|
|
$this->user = $user;
|
|
}
|
|
|
|
/**
|
|
* Get the channels the event should broadcast on.
|
|
*
|
|
* @return \Illuminate\Broadcasting\Channel|array
|
|
*/
|
|
public function broadcastOn()
|
|
{
|
|
return new PrivateChannel('updates');
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function broadcastWith()
|
|
{
|
|
return $this->user;
|
|
}
|
|
}
|