The problem I'm facing lies in pointing out a route translated to more than one language, to a controller of its own. Let me give a simple example:

Let's say I have a simple route as follows

Route::get('/contacts', 'PageController@contacts');

And I want the same controller to be used for another route, but this time translated in another language, german for example.

Route::get('/kontakte', 'PageController@contacts');

For a simple webiste, with no more than 5-6 pages, writing down the routes for all languages would not be such a pain, but for more complex website, with huge amount of pages and having more than 2 available languages, a solution like this would be ugly.

I found an older topic here, where the author suggested loading a route.php file depending on the currently selected language. But still, this would require more than one file to be edited for further need.

A point of suggestion or currently working solution would be really appreciated.Thanks for your help.

A second solution will be to store all your routes in a database (or just an array to test it in the beginning)
You will need some Page and PageLocal models for it.

Page: id, name, controller

example: 1, contact, PageController@contact

PageLocal: id, page_id, language, slug

example: 1, 1, en, contact

example: 1, 1, de, kontakte

Loop through all Pages, lazy load the PageLocal with it, and register the routes.
You can throw out the language column if you like, but lookout for duplicate slugs. Thats why a language prefix is a good idea. (And perhaps it will help with some SEO...)

I thought of the first example you provide, and I came up to the same conclusion - being unable to to have different routes for the specific language. I like the second example tho. I had something in my mind, but still wasn't sure if there is a better way. Anyway, thanks for your help, I appreciate it.
–
ArtamielSep 10 '13 at 8:49

It's been more than our, and this is the only response. Anyway, I've started to code everything the way you suggested, so I accept that as correct answer. Thanks for your time.
–
ArtamielSep 10 '13 at 10:14