Пример #1
0
 /**
  * Remove the specified Discount from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $discount = $this->discountRepository->find($id);
     if (empty($discount)) {
         Flash::error('Discount not found');
         return redirect(route('discounts.index'));
     }
     $this->discountRepository->delete($id);
     Flash::success('Discount deleted successfully.');
     return redirect(route('discounts.index'));
 }
Пример #2
0
 /**
  * Remove the specified Discount from storage.
  * DELETE /discounts/{id}
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $this->discountRepository->apiDeleteOrFail($id);
     return $this->sendResponse($id, "Discount deleted successfully");
 }