35 lines
923 B
PHP
35 lines
923 B
PHP
<?php
|
|
|
|
namespace App\Events\Bpa;
|
|
|
|
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 $exportacaoId;
|
|
public $exportacaoArquivo;
|
|
|
|
public function __construct($usuarioId, $exportacaoId, $exportacaoArquivo)
|
|
{
|
|
$this->usuarioId = $usuarioId;
|
|
$this->exportacaoId = $exportacaoId;
|
|
$this->exportacaoArquivo = $exportacaoArquivo;
|
|
}
|
|
|
|
public function broadcastOn()
|
|
{
|
|
return new PrivateChannel(app('config')->get('database.default') . '-bpa-exportacao-finalizada-usuario.' . $this->usuarioId);
|
|
}
|
|
|
|
public function broadcastAs()
|
|
{
|
|
return 'ExportacaoFinalizada';
|
|
}
|
|
}
|