persistent language prefixing with laravel

Here I want to describe how to build up a persistent language prefixing for your URLs in Laravel.

This technique requires, that the routes are named! This is just a quick sketch, and not fully complete!

In the app::before filter I detect the language. If no language was detected I redirect to the default language.

The Routes are working with a locale pattern. Here is an example:

In my global.php (e.g.) I put a new route() function and the function to do a language switch. The language switch changes just the current language but keeps the current page displayed.