35 lines
988 B
PHP
35 lines
988 B
PHP
<?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';
|
|
}
|
|
}
|