Please wrap your code examples in ``` (three back-ticks) as this is markdown. We might be able to help if we can read your snippet a little more clearly
Feb 7, 2022
5
Level 1
It shows that the route is not defined even if it is defined
I am trying to make a multilang website and ive watched a lot of tutorials but nothing works i tried the followings for routes:
Route::get('/lang/{lang}', [LanguageController::class, 'switchLang'])->name('lang.switch');
or
Route::get('/lang/{lang}', ['as' => 'lang.switch', LanguageController::class, 'switchLang']);
or
Route::get('lang/{lang}', ['as' => 'lang.switch', 'uses' => '\App\Http\Controllers\LanguageController@switchLang']);
and nothing worked i get the same error, the route is not defined somehow, and in the blade where im trying to use it, ive written:
"{{ route('lang.switch', ['lang' => 'it']) }}" in the href
i've put the question on stack too but still not an answer: https://stackoverflow.com/questions/71017971/why-does-my-language-switcher-not-translate-the-page?noredirect=1#comment125542707_71017971 what can i do ?
Please or to participate in this conversation.