I have the follow code from Laravel routes:
Route::group(['prefix'=>'{account}'], function (){
Route::group(['prefix'=>'{location}'], function (){
Route::get('/{home?}', function ($account,$location) {
$loc=explode("_", $location);
$locale = $loc[0];
$country= $loc[1];
App::setLocale($locale);
return view('homeProfPublic')->with(['account' => $account,'active' => 'home','locale'=>$locale,"country"=>$country]);
})->where('home', '/home/');
});
});
I want this route to catch:
- mysite.com/bob/US_en
- http://ift.tt/2ovpMO8
- http://ift.tt/2onWZOj
In other words I want the word "home" to be optional, but if it is there, to be only the word "home". All previuos route should redirect to the home page.
- http://ift.tt/2ovaiK9 //Should redirect to contact page.
How can I accomplish this task?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire