When clicking on the name of the site I need the user to go to the home page for the set language.
For example:
site.com/pt/posts - when the user clicks on the site icon he should be redirected to site.com/pt
site.com/br/profile - when the user clicks on the site icon he should be redirected to site.com/br
And when the user is outside the Language route group, he must be redirected to the initial site.com
Using the route name does not work, as it will call the first route with that name.
My routes look like this:
Route::group(['prefix' => 'pt', 'middleware' => 'locale:pt-br'], function () {
Route::get('/', 'pt\perfilController@authPrefer')->name('authPreferencias');
Route::get('/', function () {
return view('welcome');
})->name('home');
});
Route::get('/', function () {
return view('welcome');
})->name('home');
End my navbar:
<a href="{{ route('home') }}" class="logo"><img src="https://static.neris-assets.com/images/logo.svg" alt="16Personalities"></a>```