Livewire events not working in Laravel Modular project

52 views Asked by At

I have a Laravel project that has been modularized using the nwidart/laravel-modules package, and I’ve installed Livewire on it. However, when executing a component, I encountered the error:

The GET method is not supported for this route. Supported methods: POST.

I realized that I needed to install the mhmiton/laravel-modules-livewire package as well, so I could create components within the module path using a special artisan command. After that, the Livewire components worked correctly, but I can’t use Livewire events. Using $this->emit('event', $data); again triggers the error:

The GET method is not supported for this route. Supported methods: POST.

When I directly referenced the listener component’s path using $this->emitTo(\Modules\Products\Http\Livewire\ProductPriceHtml::class, 'event', $data);, there was no error, but although the event was emitted, the listener did not respond to the event. Has anyone faced this issue or knows how to resolve it? Please help.

0

There are 0 answers