I tried achieving that using Route:: helper but the problem is on the pages that have parameters.
<a class="dropdown-item" href="{{ route(Route::currentRouteName(), 'en') }}">
But it throws this error:
Missing required parameters for [Route: frontend.category] [URI: {locale}/{slug}]. (View: /var/www/html/project/resources/views/frontend/layouts/header.blade.php).
I cannot put parameters since the language switcher is on header and the parameters are different and many...
Any help would be appreciated!