我想使用可弯曲的结构来进行路段和即时通讯。定义链接时,我使用SeoServiceProvider。
foreach($categories as $category){
$router->get($category['path'], 'App\Http\Controllers\User\CategoryController@index')
->defaults('category', $category['id'])
->name($category['path'])
->middleware('web');
};
通过这种方式,类别结构起作用。
site.com/category
site.com/category/subcategory
site.com/category/subcategory/subsubcategory
我要建立以下结构
site.com/product
site.com/category/product
site.com/category/subcategory/product
site.com/category/subcategory/subsubcategory/product
我需要对这个嵌套循环进行操作,有没有简单的方法可以做到这一点。