Livewire 404 on frontend while working perfectly in Filament (shared installation)
Hi everyone! Livewire components on my frontend return 404 on every livewire/update POST, while everything in the Filament admin panel works flawlessly.
Key details:
Installation: I haven't installed Livewire manually via Composer. I’m relying on the Livewire package that comes as a dependency of Filament v3.
Routing: php artisan route:list shows the livewire/update endpoint correctly.
Direct Access: If I visit the endpoint via GET in the browser, I get the expected MethodNotAllowedHttpException (POST required), meaning the route is registered and reachable.
Frontend Setup: I'm using a multi-language setup (mcamara/laravel-localization) on the frontend, but the Livewire request is sent to the standard /livewire/update path.
The Problem: When interacting with a component on the homepage (e.g., a simple counter or contact form), the POST request to /livewire/update immediately returns a 404. The exact same backend setup works for Filament widgets.
Request Comparison:
1. Working Request (from Filament Dashboard):
HTTP
POST /livewire/update HTTP/1.1
Host: newc24kd.test
Content-type: application/json
Referer: http://newc24kd.test/admin/dashboard
X-Livewire:
... (Payload contains snapshot with path: "admin/dashboard")
2. Failing Request (from My Home Page):
HTTP
POST /livewire/update HTTP/1.1
Host: newc24kd.test
Content-type: application/json
Referer: http://newc24kd.test/pl
X-Livewire:
... (Payload contains snapshot with path: "pl")
What I've tried:
Clearing all caches (optimize:clear).
Manually registering components in AppServiceProvider using Livewire::component().
Ensuring only one root element exists in the Blade view.
Checking APP_URL and SESSION_DOMAIN.
It feels like Livewire is "isolated" to Filament's context and doesn't recognize components or sessions on the frontend. Has anyone encountered this when using the bundled Livewire version from Filament without a standalone installation?
Any help would be greatly appreciated!
Key details:
Installation: I haven't installed Livewire manually via Composer. I’m relying on the Livewire package that comes as a dependency of Filament v3.
Routing: php artisan route:list shows the livewire/update endpoint correctly.
Direct Access: If I visit the endpoint via GET in the browser, I get the expected MethodNotAllowedHttpException (POST required), meaning the route is registered and reachable.
Frontend Setup: I'm using a multi-language setup (mcamara/laravel-localization) on the frontend, but the Livewire request is sent to the standard /livewire/update path.
The Problem: When interacting with a component on the homepage (e.g., a simple counter or contact form), the POST request to /livewire/update immediately returns a 404. The exact same backend setup works for Filament widgets.
Request Comparison:
1. Working Request (from Filament Dashboard):
HTTP
POST /livewire/update HTTP/1.1
Host: newc24kd.test
Content-type: application/json
Referer: http://newc24kd.test/admin/dashboard
X-Livewire:
... (Payload contains snapshot with path: "admin/dashboard")
2. Failing Request (from My Home Page):
HTTP
POST /livewire/update HTTP/1.1
Host: newc24kd.test
Content-type: application/json
Referer: http://newc24kd.test/pl
X-Livewire:
... (Payload contains snapshot with path: "pl")
What I've tried:
Clearing all caches (optimize:clear).
Manually registering components in AppServiceProvider using Livewire::component().
Ensuring only one root element exists in the Blade view.
Checking APP_URL and SESSION_DOMAIN.
It feels like Livewire is "isolated" to Filament's context and doesn't recognize components or sessions on the frontend. Has anyone encountered this when using the bundled Livewire version from Filament without a standalone installation?
Any help would be greatly appreciated!
