NETBien.backend/app/Events/UpdateRoleUser.php
Moisés de Jesús Cortés Castellanos fc1e5728a7
REFACTOR: Refactorizacion y documentacion (#4)
2024-12-28 13:51:57 -06:00

45 lines
1.0 KiB
PHP

<?php namespace App\Events;
/**
* @copyright (c) 2024 Notsoweb Software (https://notsoweb.com) - All Rights Reserved
*/
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Spatie\Permission\Models\Role;
/**
* 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}"),
];
}
}