Thank you for the nice explanation... I want to translate the file into Arabic as well, but the...dir = ltr أو I don't know how, can you explain this to us?
Is there a specific reason to put the formula in a separate controller rather than in the route? Route::get('language/{locale}', function ($locale) { App::setLocale($locale); Session::put('locale', $locale); return back(); });
just change endpoint to /{lang} instead of locale/{lang} in web.php , dont forget to change to href target in view. Then in controller you need to remove return back and inside if you need to add return view('...');
THANK YOUU my friend, you saved me
Thanks!!!!
THANK YOU !!!!! I've been struggling with this for so long
I'm grateful for this fantastic tutorial.
Thank you so much! :)
Thank you bro, it works perfectly!
Thank you !
What if data comes from database and you want to perform localisation on url too ?
Helped a lot. Thank you!
Thank you for the nice explanation... I want to translate the file into Arabic as well, but the...dir = ltr أو I don't know how, can you explain this to us?
thanks a lot it's working
Thank you very much
Is there a specific reason to put the formula in a separate controller rather than in the route?
Route::get('language/{locale}', function ($locale) {
App::setLocale($locale);
Session::put('locale', $locale);
return back();
});
Thank you! How to show languages prefix on route?
just change endpoint to /{lang} instead of locale/{lang} in web.php , dont forget to change to href target in view. Then in controller you need to remove return back and inside if you need to add return view('...');
why Session::get('locale') always return NULL on midleware? laravel 11
i managed it work by using
$locale = session('locale') ?? 'en';
I think it depend on driver setting
150 points for Gryffindor
Thanks for the Gryffindor points! Much appreciated! Go Gryffindor!
work in 10?
thanks but please also explain in urdu or english
You saved my life. Thank you so much. 🙏🏻🫂