public function destroy($id)
 {
     $this->repository->delete($id);
     return redirect()->route('admin.categories.index');
 }
 public function edit($id)
 {
     $product = $this->repository->find($id);
     $categories = $this->categoryRepository->lists();
     return view('admin.products.edit', compact('product', 'categories'));
 }
 public function update(AdminCategoryRequest $request, $id)
 {
     $data = $request->all();
     $this->repository->update($data, $id);
     return redirect()->route('admin.categories.index');
 }
 public function index(CategoryRepository $repository)
 {
     $categories = $repository->paginate();
     return view('admin.categories.index', compact('categories'));
 }