我在一个电子商务网站上工作,我有一个管理面板以及一个卖方面板。我在管理面板中有一个产品模块。实际上,我也想在卖方面板中使用相同的模块,但我想对两个面板使用相同的路由。卖方面板位于子域中,管理面板位于主域中。我还提供了小组。是否可以将相同的路由与任何条件代码一起使用,而不必为管理员和卖方面板使用不同的路由。请帮帮我。
路由文件
//Seller Panel
Route::group(['domain' => 'seller.techmart.local'], function () {
//Login
Route::any('/', ['uses' => 'Frontend\Seller\Login\LoginController@getLogin', 'as' => 'login']);
Route::any('/sellerlogin', ['uses' => 'Frontend\Seller\Login\LoginController@ProcessLogin', 'as' => 'sellerlogin']);
//Dashboard
Route::any('/seller-dashboard', ['uses' => 'Frontend\Seller\Dashboard\DashboardController@GetIndex', 'as' => 'seller-dashboard']);
});
//Main Domain
Route::group(['domain' => 'techmart.local'], function () {
//Admin Panel
Route::group(['prefix' => 'masterpanel', 'middleware' => 'masterpanel'], function() {
//login
Route::any('/', ['uses' => 'Admin\LoginController@getLogin', 'as' => 'login']);
Route::any('processlogin', ['uses' => 'Admin\LoginController@doLogin', 'as' => 'processlogin']);
Route::any('/logout', ['uses' => 'Admin\LoginController@logout', 'as' => 'logout']);
//dashboard
Route::any('dashboard', ['uses' => 'Admin\DashboardController@getDashboard', 'as' => 'dashboard']);
/********** Category **********/
Route::any('/brand', ['uses' => 'Brand\BrandController@ManageBrand', 'as' => 'brand']);
Route::any('/savebrand', ['uses' => 'Brand\BrandController@SaveBrand', 'as' => 'savebrand']);
Route::any('/viewbrand/{id}', ['uses' => 'Brand\BrandController@ViewBrand', 'as' => 'viewbrand']);
Route::any('/editbrand/{id}', ['uses' => 'Brand\BrandController@EditBrand', 'as' => 'editbrand']);
Route::any('/updatebrand', ['uses' => 'Brand\BrandController@UpdateBrand', 'as' => 'updatebrand']);
Route::any('/deletebrand', ['uses' => 'Brand\BrandController@DeleteBrand', 'as' => 'deletebrand']);
Route::any('/importbrand', ['uses' => 'Brand\BrandController@ImportBrand', 'as' => 'importbrand']);
Route::any('/deleteselectedbrand', ['uses' => 'Brand\BrandController@DeleteSelectedBrand', 'as' => 'deleteselectedbrand']);
Route::any('/deleteallbrand', ['uses' => 'Brand\BrandController@DeleteAllBrand', 'as' => 'deleteallbrand']);
/********** Product Type **********/
Route::any('/addproducttype', ['uses' => 'ProductType\ProductTypeController@AddProductType', 'as' => 'addproducttype']);
Route::any('/saveproducttype', ['uses' => 'ProductType\ProductTypeController@SaveProductType', 'as' => 'saveproducttype']);
Route::any('/manageproducttype', ['uses' => 'ProductType\ProductTypeController@ManageProductType', 'as' => 'manageproducttype']);
Route::any('/editproducttype/{id}', ['uses' => 'ProductType\ProductTypeController@EditProductType', 'as' => 'editproducttype']);
Route::any('/updateproducttype', ['uses' => 'ProductType\ProductTypeController@UpdateProductType', 'as' => 'updateproducttype']);
Route::any('/deleteproducttype', ['uses' => 'ProductType\ProductTypeController@DeleteProductType', 'as' => 'deleteproducttype']);
Route::any('/deleteselectedproducttype', ['uses' => 'ProductType\ProductTypeController@DeleteSelectedRecords', 'as' => 'deleteselectedproducttype']);
/********** Category **********/
//Category
Route::any('/category', ['uses' => 'Category\CategoryController@ManageCategory', 'as' => 'category']);
Route::any('/savecategory', ['uses' => 'Category\CategoryController@SaveCategory', 'as' => 'savecategory']);
Route::any('/viewcategory/{id}', ['uses' => 'Category\CategoryController@ViewCategory', 'as' => 'viewcategory']);
Route::any('/editcategory/{id}', ['uses' => 'Category\CategoryController@EditCategory', 'as' => 'editcategory']);
Route::any('/updatecategory', ['uses' => 'Category\CategoryController@UpdateCategory', 'as' => 'updatecategory']);
Route::any('/deletecategory', ['uses' => 'Category\CategoryController@DeleteCategory', 'as' => 'deletecategory']);
Route::any('/deleteselectedcategorylvl1', ['uses' => 'Category\CategoryController@DeleteSelectedCategoryLvl1', 'as' => 'deleteselectedcategorylvl1']);
Route::any('/view-subcategory-level3-manage', ['uses' => 'Category\CategoryController@ViewSubCategoryLvl3_Manage', 'as' => 'view-subcategory-level3-manage']);
Route::any('/view-subcategory-level4-manage', ['uses' => 'Category\CategoryController@ViewSubCategoryLvl4_Manage', 'as' => 'view-subcategory-level4-manage']);
//Sub Category
Route::any('/category-level2', ['uses' => 'Category\CategoryController@ManageCategoryLvl2', 'as' => 'category-level2']);
Route::any('/savesubcategory', ['uses' => 'Category\CategoryController@SaveSubCategory', 'as' => 'savesubcategory']);
Route::any('/viewsubcategory/{id}', ['uses' => 'Category\CategoryController@ViewSubCategory', 'as' => 'viewsubcategory']);
Route::any('/editsubcategory/{id}', ['uses' => 'Category\CategoryController@EditSubCategory', 'as' => 'editsubcategory']);
Route::any('/updatesubcategory', ['uses' => 'Category\CategoryController@UpdateSubCategory', 'as' => 'updatesubcategory']);
Route::any('/deletesubcategory', ['uses' => 'Category\CategoryController@DeleteSubCategory', 'as' => 'deletesubcategory']);
Route::any('/deleteselectedcategorylvl2', ['uses' => 'Category\CategoryController@DeleteSelectedCategoryLvl2', 'as' => 'deleteselectedcategorylvl2']);
//Sub Category Lvl3
Route::any('/category-level3', ['uses' => 'Category\CategoryController@ManageCategoryLvl3', 'as' => 'category-level3']);
Route::any('/savesubcategorylvl3', ['uses' => 'Category\CategoryController@SaveSubCategoryLvl3', 'as' => 'savesubcategorylvl3']);
Route::any('/view-subcategory-level3/{id}', ['uses' => 'Category\CategoryController@ViewSubCategoryLvl3', 'as' => 'view-subcategory-level3']);
Route::any('/edit-subcategory-level3/{id}', ['uses' => 'Category\CategoryController@EditSubCategoryLvl3', 'as' => 'edit-subcategory-level3']);
Route::any('/updatesubcategorylvl3', ['uses' => 'Category\CategoryController@UpdateSubCategoryLvl3', 'as' => 'updatesubcategorylvl3']);
Route::any('/deletesubcategorylvl3', ['uses' => 'Category\CategoryController@DeleteSubCategoryLvl3', 'as' => 'deletesubcategorylvl3']);
Route::any('/deleteselectedcategorylvl3', ['uses' => 'Category\CategoryController@DeleteSelectedCategoryLvl3', 'as' => 'deleteselectedcategorylvl3']);
//Sub Category Lvl4
Route::any('/category-level4', ['uses' => 'Category\CategoryController@ManageCategoryLvl4', 'as' => 'category-level4']);
Route::any('/savesubcategorylvl4', ['uses' => 'Category\CategoryController@SaveSubCategoryLvl4', 'as' => 'savesubcategorylvl4']);
Route::any('/view-subcategory-level4/{id}', ['uses' => 'Category\CategoryController@ViewSubCategoryLvl4', 'as' => 'view-subcategory-level4']);
Route::any('/edit-subcategory-level4/{id}', ['uses' => 'Category\CategoryController@EditSubCategoryLvl4', 'as' => 'edit-subcategory-level4']);
Route::any('/updatesubcategorylvl4', ['uses' => 'Category\CategoryController@UpdateSubCategoryLvl4', 'as' => 'updatesubcategorylvl4']);
Route::any('/deletesubcategorylvl4', ['uses' => 'Category\CategoryController@DeleteSubCategoryLvl4', 'as' => 'deletesubcategorylvl4']);
Route::any('/deleteselectedcategorylvl4', ['uses' => 'Category\CategoryController@DeleteSelectedCategoryLvl4', 'as' => 'deleteselectedcategorylvl4']);
//Import Category
Route::any('/categoryimport', ['uses' => 'Category\CategoryController@CategoryImport', 'as' => 'categoryimport']);
Route::any('/importcategorylvl1', ['uses' => 'Category\CategoryController@ImportCategoryLvl1', 'as' => 'importcategorylvl1']);
Route::any('/importcategorylvl2', ['uses' => 'Category\CategoryController@ImportCategoryLvl2', 'as' => 'importcategorylvl2']);
Route::any('/importcategorylvl3', ['uses' => 'Category\CategoryController@ImportCategoryLvl3', 'as' => 'importcategorylvl3']);
Route::any('/importcategorylvl4', ['uses' => 'Category\CategoryController@ImportCategoryLvl4', 'as' => 'importcategorylvl4']);
/********** Model **********/
Route::any('/addmodel', ['uses' => 'ModelComponent\ModelController@AddModel', 'as' => 'addmodel']);
Route::any('/addmodelprocess', ['uses' => 'ModelComponent\ModelController@AddModelProcess', 'as' => 'addmodelprocess']);
Route::any('/importmodel', ['uses' => 'ModelComponent\ModelController@ImportModel', 'as' => 'importmodel']);
Route::any('/importmodelprocess', ['uses' => 'ModelComponent\ModelController@ImportModelProcess', 'as' => 'importmodelprocess']);
Route::any('/managemodel', ['uses' => 'ModelComponent\ModelController@ManageModel', 'as' => 'managemodel']);
Route::any('/editmodel/{id}', ['uses' => 'ModelComponent\ModelController@EditModel', 'as' => 'editmodel']);
Route::any('/updatemodel', ['uses' => 'ModelComponent\ModelController@UpdateModel', 'as' => 'updatemodel']);
Route::any('/deletemodel', ['uses' => 'ModelComponent\ModelController@DeleteModel', 'as' => 'deletemodel']);
Route::any('/deleteselectedmodel', ['uses' => 'ModelComponent\ModelController@DeleteSelectedModel', 'as' => 'deleteselectedmodel']);
/********** Tech Specs **********/
Route::any('/addtechspecsformat', ['uses' => 'TechSpecs\TechSpecsController@AddSpecsFormat', 'as' => 'addtechspecsformat']);
Route::any('/addtechspecsformatprocess', ['uses' => 'TechSpecs\TechSpecsController@AddSpecsFormatProcess', 'as' => 'addtechspecsformatprocess']);
Route::any('/specsgetmodel', ['uses' => 'TechSpecs\TechSpecsController@GetModel', 'as' => 'specsgetmodel']);
Route::any('/managespecsformat', ['uses' => 'TechSpecs\TechSpecsController@ManageSpecsFormat', 'as' => 'managespecsformat']);
Route::any('/viewspecsformat', ['uses' => 'TechSpecs\TechSpecsController@ViewSpecsFormat', 'as' => 'viewspecsformat']);
Route::any('/editspecsformat/{id}', ['uses' => 'TechSpecs\TechSpecsController@EditSpecsFormat', 'as' => 'editspecsformat']);
Route::any('/deletespecsformat', ['uses' => 'TechSpecs\TechSpecsController@DeleteSpecsFormat', 'as' => 'deletespecsformat']);
Route::any('/deleteselectedformat', ['uses' => 'TechSpecs\TechSpecsController@DeleteSelectedSpecsFormat', 'as' => 'deleteselectedformat']);
/********** Products **********/
Route::any('/products', ['uses' => 'Products\ProductController@ManageProducts', 'as' => 'products']);
Route::any('/saveproduct', ['uses' => 'Products\ProductController@SaveProduct', 'as' => 'saveproduct']);
Route::any('/viewproduct/{id}', ['uses' => 'Products\ProductController@ViewProduct', 'as' => 'viewproduct']);
Route::any('/editproduct/{id}', ['uses' => 'Products\ProductController@EditProduct', 'as' => 'editproduct']);
Route::any('/updateproduct', ['uses' => 'Products\ProductController@UpdateProduct', 'as' => 'updateproduct']);
Route::any('/deleteproduct', ['uses' => 'Products\ProductController@DeleteProduct', 'as' => 'deleteproduct']);
Route::any('/productsgetbrand', ['uses' => 'Products\ProductController@ProductsGetBrandDetails', 'as' => 'productsgetbrand']);
Route::any('/productgetsku', ['uses' => 'Products\ProductController@GetSKU', 'as' => 'productgetsku']);
//Route::any('/getselectedproductcat', ['uses' => 'Products\ProductController@GetSelectedProdCat', 'as' => 'getselectedproductcat']);
Route::any('/productscategory', ['uses' => 'Products\ProductController@GetCategory', 'as' => 'productscategory']);
Route::any('/productsgetmodel', ['uses' => 'Products\ProductController@GetModel', 'as' => 'productsgetmodel']);
Route::any('/productgettechspecs', ['uses' => 'Products\ProductController@ProductGetSpecs', 'as' => 'productgettechspecs']);
Route::any('/deleteselectedproducts', ['uses' => 'Products\ProductController@DeleteSelectedRecords', 'as' => 'deleteselectedproducts']);
/********** Attribute **********/
//Attribute
Route::any('/attribute', ['uses' => 'Attribute\AttributeController@ManageAttributes', 'as' => 'attribute']);
Route::any('/save-attribute-set', ['uses' => 'Attribute\AttributeController@SaveAttributeSet', 'as' => 'save-attribute-set']);
Route::any('/save-attribute', ['uses' => 'Attribute\AttributeController@SaveAttribute', 'as' => 'save-attribute']);
});
//Scraper
Route::group(['prefix' => 'vendorpanel', 'middleware' => 'vendorpanel'], function() {
//Login
Route::any('/', ['uses' => 'Scraper\ScraperController@getLogin', 'as' => 'login']);
Route::any('processlogin-scraper', ['uses' => 'Scraper\ScraperController@doLogin', 'as' => 'processlogin-scraper']);
//dashboard
Route::any('vendor-dashboard', ['uses' => 'Scraper\ScraperController@getDashboard', 'as' => 'vendor-dashboard']);
Route::any('/logout-vendor', ['uses' => 'Scraper\ScraperController@logout', 'as' => 'logout-vendor']);
//Scraping
Route::any('/process-scraping', ['uses' => 'Scraper\ScraperController@doScraping', 'as' => 'process-scraping']);
});
//Frontend
Route::get('/', function () {
return view('frontend.welcome');
});
});