public function single($url) { if (!menu301s($url)) { $category = $this->menuCategory->where('url', $url)->first(); $items = $this->menuItem->where('archive', 0)->where('category', $category->id)->where('archive', 0)->where('draft', 0)->orderby('order', 'asc')->get(); $metaTitle = 'Menu ยป ' . $category->name; return view('pages.menu-single', compact('category', 'items', 'metaTitle')); } return menu301s($url); }
public function doEditDish() { $mid = Input::get('mid'); $menuItem = MenuItem::where('mid', '=', $mid)->get(); foreach ($menuItem->toArray() as $im) { $idish = Input::get('imname_' . $im['imid']); $price = Input::get('unit_price_' . $im['imid']); foreach ($idish as $key => $dish) { Dish::insert(['dname' => $dish, 'imid' => $im['imid'], 'unit_price' => $price[$key]]); } } return redirect()->route('/teabreak/menu'); }
public function archived() { $categories = $this->menuCategory->where('archive', 1)->orderby('order', 'asc')->get(); $items = $this->menuItem->where('archive', 1)->orderby('name', 'asc')->get(); return view('admin.menu.index', compact('items', 'categories')); }