mardi 27 décembre 2016

How to add dynamically prefix to routes?

In session i set default language code for example de. And now i want that in link i have something like this: http://ift.tt/2iaAerG.

Problem is that i cant access session in routes. Any suggestion how can i do this?

  $langs = Languages::getLangCode();
    if (in_array($lang, $langs)) {
      Session::put('locale', $lang);
      return redirect::back();
    }
    return;

Route::get('blog/articles', 'StandardUser\UserBlogController@AllArticles');

So i need to pass to route as prefix this locale session.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hpCdcW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire