- ADD: Observador de roles - ADD: Activar sesion en API - ADD: Historial de cambios
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php namespace App\Events;
|
|
/**
|
|
* @copyright (c) 2024 Notsoweb Software (https://notsoweb.com) - All Rights Reserved
|
|
*/
|
|
|
|
use App\Models\Role;
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
/**
|
|
* Role de usuario actualizado
|
|
*
|
|
* @author Moisés Cortés C. <moises.cortes@notsoweb.com>
|
|
*
|
|
* @version 1.0.0
|
|
*/
|
|
class UpdateRoleUser implements ShouldBroadcast
|
|
{
|
|
use Dispatchable,
|
|
InteractsWithSockets,
|
|
SerializesModels;
|
|
|
|
/**
|
|
* Crear instancia del evento
|
|
*/
|
|
public function __construct(
|
|
public Role $role
|
|
) {}
|
|
|
|
/**
|
|
* Obtener los canales a los que se debe transmitir el evento
|
|
*
|
|
* @return array<int, \Illuminate\Broadcasting\Channel>
|
|
*/
|
|
public function broadcastOn(): array
|
|
{
|
|
return [
|
|
new PrivateChannel("App.Models.Role.{$this->role->id}"),
|
|
];
|
|
}
|
|
}
|