public function getEdit($id) { $categories = new Category(); $allCategory = $categories->getCategoriesDropDown(); $branches = new Branch(); $branchAll = $branches->getBranchesDropDown(); $subCategories = new SubCategory(); $allSubCategory = $subCategories->getSubCategoriesDropDown(); $products = Product::find($id); return view('Products.edit', compact('branchAll'))->with('products', $products)->with('categoryAll', $allCategory)->with('subCategoryAll', $allSubCategory); }