productRepo = $productRepo; } public function index() { $products = Product::scope() ->withTrashed() ->orderBy('created_at', 'desc'); return $this->listResponse($products); } public function store(CreateProductRequest $request) { $product = $this->productRepo->save($request->input()); return $this->itemResponse($product); } public function update(UpdateProductRequest $request, $publicId) { if ($request->action) { return $this->handleAction($request); } $data = $request->input(); $data['public_id'] = $publicId; $product = $this->productRepo->save($data, $request->entity()); return $this->itemResponse($product); } public function destroy($publicId) { //stub } }