It is very easy to use Localziation, just you need to use localized method in your routes file like this :
1Route::localized(function() { 2 Route::get('/page', function() {3 return 'Pharaonic';4 });5});6 7// domain.com/ar/page sub-directory8// ar.domain.com/page sub-domain9// domain.com.eg/page ccTLD
1locale()->current // Getting current locale 2locale()->default // Getting default locale 3locale()->supported // Getting supported locales list 4locale()->list // Getting list of all locales (supported or not) 5 6locale()->isSupportedLocale('ar') // Checking if locale has been supported 7locale()->isSupportedccTLD('eg') // Checking if ccTLD has been supported 8 9locale()->getName() // Getting current locale name10locale()->getNativeName() // Getting current locale native name11locale()->getLanguage() // Getting current language code12locale()->getRegion() // Getting current region code if exists13locale()->isRTL() // Checking if locale is rtl direction14locale()->getDirection() // Getting current locale direction (rtl, ltr)15 16// Getting current route with different locale17locale('en')->current()18 19// Getting localized url with the current locale20locale()->route('article.show', $article->id)21 22// Getting localized url with specified locale23locale('fr')->route('article.show', ['article' => $article->id])24 25// Getting un-localized url26locale()->unLocalizedRoute('article.show', $article->id)