Example #1
0
 public function destroy(DestroyFormatCDRequest $request)
 {
     //get Data
     $dataRequest = $request->all();
     $model = new Format_cd();
     if ($model->where('id', $dataRequest['id'])->update(['status' => Format_cd::HIDE])) {
         return redirect()->back()->with('success', 'Delete!');
     } else {
         return redirect_errors('Have error, cannot delete!');
     }
 }
Example #2
0
 public static function getSideBarFE()
 {
     if (Cache::has('side_bar_FE')) {
         $sideBar = Cache::get('side_bar_FE');
     } else {
         $controllerType = new Type();
         $controller4mat = new Format_cd();
         $sideBar = $controllerType->sideBar();
         $sideBar .= '<li class="sidebar-brand"><a href="#">';
         $sideBar .= 'Format CD';
         $sideBar .= '</a></li>';
         $sideBar .= $controller4mat->sideBar();
         Cache::forever('side_bar_FE', $sideBar);
     }
     return $sideBar;
 }
Example #3
0
 public function index()
 {
     View::share(['title' => 'Product management', 'sideBar' => NavigatorHelper::getSideBarBE()]);
     $type = Type::all(['id', 'name'])->toArray();
     $format = Format_cd::all(['id', 'name'])->toArray();
     $price_groups = Price_group::all(['id', 'name', 'root_price', 'price'])->toArray();
     return view('catalog.product.list')->with(['type' => $type, 'format' => $format, 'price_groups' => $price_groups]);
 }