/** * @param Request $request * * @throws GeneralException * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function newProduct(Request $request) { if ($request['product_type'] == 'downloadable') { $a = $this->category->eagerLoad('category_description'); // dd($a); return view('backend.product.create_downloadable')->withCategory($request['product_category_id'])->withEavcategorys($this->eavAttributeCategory->getAllEavCategory())->withAttributes($this->eavAttribute->getWhereCategory($request['product_category_id']))->withCategorys($this->category->eagerLoad('category_description'))->withTaxs($this->tax->getAll()); } elseif ($request['product_type'] == 'non-downloadable') { return view('backend.product.create_non_downloadable')->withCategory($request['product_category_id'])->withEavcategorys($this->eavAttributeCategory->getAllEavCategory())->withAttributes($this->eavAttribute->getWhereCategory($request['product_category_id']))->withCategorys($this->category->eagerLoad('category_description'))->withTaxs($this->tax->getAll()); } throw new GeneralException('Select proper Product Type and Try again!'); }
public function create() { return view('backend.product.create')->withEavcategorys($this->eavAttributeCategory->getAllEavCategory()); }