I'm using this package - https://github.com/mcamara/laravel-localization for localization. And it works fine when I manually change the url to /en, /de etc... But is it possible to change url when (html) option is selected. For example I want to add this to my navigation bar:
<form action = "somePage" method = "POST">
<select>
<option value = "en">English</option>
<option value = "de">Deutsch</option>
...
</select>
</form>
Is there an option in Laravel to add "value" to the string?
EDIT
With this code, it changes URL, but I want just to replace /de and /en. For example, it changes http://localhost:8000/en/home to http://localhost:8000/en ... I want it to stay on the same page, just to change the language. Example: http://localhost:8000/en/profile to http://localhost/de/profile
<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">
<option value="">Select...</option>
<option value={{ url('/en') }}>English</option>
<option value="{{ url('/de') }}">Deutsch</option>