* * @version 1.0.0 */ class GlobalNotification implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; /** * Crear nueva instancia del evento * * @param string $message El mensaje a transmitir * @param string $type El tipo de mensaje * @param string $timeout Tiempo en segundos */ public function __construct( public $message, public $type = 'success', public $timeout = 15 ) {} /** * Transmitir notificación por canal privado * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return new PrivateChannel("notifications"); } }