diff --git a/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php b/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php new file mode 100644 index 00000000..ae36c435 --- /dev/null +++ b/app/Http/Controllers/Shop/Admin/PriceGenericCategoryController.php @@ -0,0 +1,45 @@ +render('Shop.Admin.PriceGenericCategories.list', $data); + } + + public function create() + { + return view('Shop.Admin.PriceGenericCategories.create'); + } + + public function edit($id) + { + $data['generic_category'] = PriceGenericCategories::get($id)->toArray(); + return view('Shop.Admin.PriceGenericCategories.edit', $data); + } + + public function store(Request $request) + { + $ret = PriceGenericCategories::store($request->all()); + return redirect()->route('Shop.Admin.PriceGenericCategories.index'); + } + + public function show($id) + { + $data = PriceGenericCategories::get($id); + return view('Shop.Admin.PriceGenericCategories.view', $data); + } + + public function destroy($id) + { + return PriceGenericCategories::destroy($id); + } +} diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index 728a6028..c6f88c56 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -37,6 +37,9 @@ class Shop $menu->addTo('shop', 'Prix génériques', [ 'route' => 'Shop.Admin.PriceGenerics.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.PriceGenerics.*'])->order(10); + $menu->addTo('shop', 'Catégories Prix génériques', [ 'route' => 'Shop.Admin.PriceGenericCategories.index', 'permission' => 'backend_access' ]) + ->activeIfRoute(['Shop.Admin.PriceGenericCategories.*'])->order(11); + $menu->addTo('shop', 'Packages', [ 'route' => 'Shop.Admin.Packages.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.Packages.*'])->order(12); diff --git a/routes/Shop/Admin/PriceGenericCategories.php b/routes/Shop/Admin/PriceGenericCategories.php new file mode 100644 index 00000000..f449bf17 --- /dev/null +++ b/routes/Shop/Admin/PriceGenericCategories.php @@ -0,0 +1,12 @@ +name('PriceGenericCategories.')->group(function () { + Route::get('', 'PriceGenericCategoryController@index')->name('index'); + Route::get('create', 'PriceGenericCategoryController@create')->name('create'); + Route::delete('destroy/{id?}', 'PriceGenericCategoryController@destroy')->name('destroy'); + Route::post('update', 'PriceGenericCategoryController@update')->name('update'); + Route::post('store', 'PriceGenericCategoryController@store')->name('store'); + Route::get('edit/{id}', 'PriceGenericCategoryController@edit')->name('edit'); + +}); + diff --git a/routes/Shop/Admin/route.php b/routes/Shop/Admin/route.php index 0f598a2b..aa740b25 100644 --- a/routes/Shop/Admin/route.php +++ b/routes/Shop/Admin/route.php @@ -14,6 +14,7 @@ Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')-> include __DIR__ . '/OrderPayments.php'; include __DIR__ . '/Orders.php'; include __DIR__ . '/Packages.php'; + include __DIR__ . '/PriceGenericCategories.php'; include __DIR__ . '/PriceGenerics.php'; include __DIR__ . '/Tags.php'; include __DIR__ . '/TagGroups.php';