php - similar route names in different namespace -


so in routes.php have

route::group(['namespace' => 'cp', 'prefix' => 'cp'], function() {     route::get('/shop' , 'shopcontroller@index')->name('shop_index'); });   route::get('/shop' , 'shopcontroller@index')->name('shop_index'); 

basically 2 similar address 1 admin area in cp namespace , directory , other clients

so in admin viwe when want link page have

<a href="{{route('shop_index')}}"> shop </a> 

which wouldn't work becuz have 2 different routes same name have change 1 of names shop_index_cp

is there anyway somehow use namespace in there , avoid ? like

<a href="{{route('cp\shop_index')}}"> shop </a> 

namespace attribute used tell router base namespace controllers. doesn't affect route names or way can reference them. there no way use namespaces refer similar routes - exact name used making names unique way go.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -