I have three languages on my site:
en, fr, de
I want all of the pages on the site to have the language in the url in the first segment, ie.
/page ->set Locale as English
/de/page ->set Locale as German
/fr/page ->set Locale as French
Any idea how I can apply this to all routes? The language must be set based on the first URL segment, if its not 'de' or 'fr' then set the language as English. Thanks!
I've got it working now with a foreach loop.
In config/app.php:
And middleware: