This commit is contained in:
34
api/app/Events/AtencaoBasica/ExportacaoFinalizadaEvent.php
Normal file
34
api/app/Events/AtencaoBasica/ExportacaoFinalizadaEvent.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events\AtencaoBasica;
|
||||
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
|
||||
class ExportacaoFinalizadaEvent implements ShouldBroadcastNow
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets;
|
||||
|
||||
public $usuarioId;
|
||||
public $exportacaoArquivoId;
|
||||
public $exportacaoArquivoNome;
|
||||
|
||||
public function __construct($usuarioId, $exportacaoArquivoId, $exportacaoArquivoNome)
|
||||
{
|
||||
$this->usuarioId = $usuarioId;
|
||||
$this->exportacaoArquivoId = $exportacaoArquivoId;
|
||||
$this->exportacaoArquivoNome = $exportacaoArquivoNome;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel(app('config')->get('database.default') . '-atencao-basica-exportacao-finalizada-usuario.' . $this->usuarioId);
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'ExportacaoFinalizada';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user