codezero-be / laravel-localized-routes

⭐️ A convenient way to set up and use localized routes in a Laravel app.
MIT License
504 stars 46 forks source link

Call to undefined method Composer\Util\Platform::getCwd() #103

Closed AndriiTereshchuk closed 11 months ago

AndriiTereshchuk commented 11 months ago

Please tell me how to fix this error Call to undefined method Composer\Util\Platform::getCwd()?

ivanvermeyen commented 11 months ago

Hi,

Are you using Composer 2.x? The method should exist. Let me know if I need to investigate further.

AndriiTereshchuk commented 11 months ago

Hi,

Are you using Composer 2.x? The method should exist. Let me know if I need to investigate further.

Composer version 2.2.6 2022-02-04 17:00:38

AndriiTereshchuk commented 11 months ago

Hi, Are you using Composer 2.x? The method should exist. Let me know if I need to investigate further.

Composer version 2.2.6 2022-02-04 17:00:38

I updated Composer to v2.6.5 and it worked. The question is not relevant

ivanvermeyen commented 11 months ago

Hi,

I'm glad it works now. I'll have to review the required Composer version it seems. Thanks for letting me know!

ivanvermeyen commented 11 months ago

Supporting the same language for multiple countries is something I've been thinking about but it is difficult because of how this package works. So at this moment it's not possible.

You can define an internal locale for translations etc. as the array key and a custom slug as the value. But they need to be unique, to properly connect a URL to a route and locale.

You could add redirect routes from "/be" to "/ru" for example. I will keep this in mind tho.