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