public function categoryIndex(Category $categoryModel, $category_id, $provider_id = false) { $ids = $categoryModel->getChild($category_id); $chain = $categoryModel->getParents($category_id); return $this->buildIndex('category', $ids, $chain, false, $provider_id); }
public function categoryIndex(Category $categoryModel, $id) { $ids = $categoryModel->getChild($id); $chain = $categoryModel->getParents($id); return $this->buildIndex('category', $ids, $chain); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create(Category $category) { return view('category.create', ['data' => $category->getParents()]); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, Category $categoryModel, Provider $providerModel) { if (!right('EditCategory')) { abort(404); } $category = $categoryModel->getCategory($id); if (count($category) < 1) { abort(404); } $fullList = $categoryModel->getFullCategoriesList(); $providers_list = $providerModel->getExistInCategoryProvedrsList($id); $chain = $categoryModel->getParents($id); return view('category.edit')->with('title', 'Редактирование категории ' . $category->name)->with('category', $category)->with('chain', $chain)->with('fullList', $fullList)->with('provider_list', $providers_list)->with('current_id', $id); }