Laravel 12.29 issues with Livewire custom endpoints
Hello!
I'm having a hard time solving the issue with the 12.29+ version of Laravel and Livewire custom endpoints.
I have a multi-language site and I'm using Mcamara\LaravelLocalization for that.
In the routes previously, I set up a route group with required middlewares for localization and added Livewire endpoints like this.
Route::group([ 'prefix' => LaravelLocalization::setLocale(),
'middleware' => [
'localeSessionRedirect',
'localizationRedirect',
'localeViewPath',
],
],
function () {
Livewire::setUpdateRoute(static function ($handle) {
return Route::post('/livewire/update', $handle)->name('livewire.update');
});
Livewire::setScriptRoute(static function ($handle) {
return Route::get('/livewire/livewire.js', $handle)->name('livewire.script');
});
}
);
In the network tab when making any post request or like that, I can see for example that /en/livewire/update is called and works as expected but after upgrading to 12.29 or a newer version of Laravel, I'm getting console errors, 404 /livewire/update is not found.
The last version where this logic works is 12.28 but after that nothing.
Is there something missing or something has changed majorily after the update?
Thanks!
Please or to participate in this conversation.