Home  >  Q&A  >  body text

Laravel Livewire not working after streaming to live server running nginx

I'm having trouble transferring my project to the production server and livewire stops working. The server is running nginx.

When I fire the wire:click event (click the button) inside the component, I get the error in the response:

SymfonyComponentHttpKernelExceptionMethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. in file /data/*****/****/******/*******/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php on line 118

#0 /data/****/*****/*****/*****/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php(104): IlluminateRoutingAbstractRouteCollection->methodNotAllowed()

This is a fresh Laravel installation, almost empty components, just simple dd(). It's not a full page component, so I didn't set the route type (GET or POST) in paths/web.php. This component is simply called via @livewire() within the Blade file. It runs on my local machine using apache on docker and on another live server using apache without any issues.

Do you know what causes this problem? Thanks for your help in advance.

P粉043470158P粉043470158334 days ago457

reply all(1)I'll reply

  • P粉803527801

    P粉8035278012023-12-14 17:21:11

    I think you should run php artisan livewire:publish --assets to the public Livewire

    reply
    0
  • Cancelreply