Wednesday, March 1, 2017

[SOLVED]Laravel 5.4 : Translate routes

is there a simple way to translate my routes in Laravel 5.4. My translation files located in here:
/resources
/lang
    /en
        routes.php
    /de
        routes.php

In my web.php i define my routes like this:
Route::get('/{locale}', function ($locale) {
    App::setLocale($locale);

    return view('welcome');
});

Route::get('{locale}/contact', 'ContactController@index');

I have found very elaborate solutions or solutions for Laravel 4. I am sure that Laravel has also provided a simple solution. Can someone explain to me the best approach?
Thanks.



via Sascha

Advertisement