This commit is contained in:
38
api/app/Events/PainelSenha/FilaEvent.php
Normal file
38
api/app/Events/PainelSenha/FilaEvent.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\PainelSenha;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
class FilaEvent implements ShouldBroadcastNow
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets;
|
||||
|
||||
private $setorTipoId = null;
|
||||
private $centroCustoId = null;
|
||||
private $moduloIdentificador = null;
|
||||
public $salaId = null;
|
||||
public $fila = null;
|
||||
|
||||
public function __construct($setorTipoId, $centroCustoId, $moduloIdentificador, $fila, $salaId = null)
|
||||
{
|
||||
$this->setorTipoId = $setorTipoId;
|
||||
$this->centroCustoId = $centroCustoId;
|
||||
$this->moduloIdentificador = $moduloIdentificador;
|
||||
$this->salaId = $salaId;
|
||||
$this->fila = $fila;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel(app('config')->get('database.default') . '-painel-senha-fila');
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return "{$this->setorTipoId}.{$this->centroCustoId}.{$this->moduloIdentificador}.updated";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user