79255205

Date: 2024-12-05 15:08:17
Score: 3
Natty:
Report link

El problema es al invocar el evento desde JS, lo solucioné invocando un evento de PHP y este se encargaría de invocar al evento principal, ya que PHP sí permite mandar un parámetro simple.

JS

Livewire.dispatch('dispatchSweetAlertEvent', {event: event, id: id});

Evento en PHP

#[On('dispatchSweetAlertEvent')]
public function dispatchEvent($event, $id): void
{
    $this->dispatch($event, $id);
}
Reasons:
  • Blacklisted phrase (2.5): solucion
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Fredy Alexander Xalín Aguín