laravel-localized-routes icon indicating copy to clipboard operation
laravel-localized-routes copied to clipboard

WIP - Support Livewire

Open ivanvermeyen opened this issue 2 years ago • 4 comments

Support Livewire (#58)

Attempt to create a fresh Request from the current URL.

If this works we can pass Livewire::originalUrl() when the {locale}/livewire/message/{name} endpoint is accessed.

Unfortunately Livewire::originalUrl() does not include the query string.

ivanvermeyen avatar Apr 08 '23 19:04 ivanvermeyen

This looks great @ivanvermeyen! That should probably do it

I'll swap this for my hacky workaround and see if I run in to any compatibility issues

I can make some time to get back into it somewhere next week 👍🏻

gwleuverink avatar Apr 08 '23 20:04 gwleuverink

Hello, do you plan to add PR to package? I have same problem with livewire.

tomas-doudera avatar Feb 03 '24 21:02 tomas-doudera

Hello, do you plan to add PR to package? I have same problem with livewire.

Because I don't use Livewire myself, I'm a bit hesitating to merge this. I can't easily test it and assure that it is working.

However, if you want to try this, you can just download the updated SetLocale middleware and use that instead of the one in the main repo. It has not been tested with Livewire 3 though.

https://github.com/codezero-be/laravel-localized-routes/blob/d7b92c5f57e99608802a99e5ccea0f62e2453350/src/Middleware/SetLocale.php

ivanvermeyen avatar Feb 07 '24 11:02 ivanvermeyen

Same problem with Livewire

ianfortier avatar Mar 01 '24 01:03 ianfortier