Posted by Arjun Arjun on Saturday 13th June 2015, 1 minute read

Named Route Groups

Route::get('admin/home',['as' => 'home',function(){
   echo 'admin home';
}]);


// view 
echo route('home'); // output : http://localhost/admin/home
Route::group(['prefix' => 'admin'],function(){
Route::get('home',['as' => 'home',function(){
   echo 'admin home';
}]);
 });

// view 
echo route('home'); // output : http://localhost/admin/home
Route::group(['prefix' => 'admin','as' => 'admin'],function(){
Route::get('home',['as' => 'home',function(){
   echo 'admin home';
}]);
 });

// view 
echo route('admin.home'); // output : http://localhost/admin/home
...
Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.