/** * Remove the specified ProductCost from storage. * * @param int $id * * @return Response */ public function destroy($id) { $productCost = $this->productCostRepository->find($id); if (empty($productCost)) { Flash::error('ProductCost not found'); return redirect(route('productCosts.index')); } $this->productCostRepository->delete($id); Flash::success('ProductCost deleted successfully.'); return redirect(route('productCosts.index')); }
/** * Remove the specified ProductCost from storage. * DELETE /productCosts/{id} * * @param int $id * * @return Response */ public function destroy($id) { $this->productCostRepository->apiDeleteOrFail($id); return $this->sendResponse($id, "ProductCost deleted successfully"); }