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
Post a Comment