This commit is contained in:
34
api/app/Events/Bpa/ExportacaoFinalizadaEvent.php
Normal file
34
api/app/Events/Bpa/ExportacaoFinalizadaEvent.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user