/**
  * Remove the specified Product from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $product = $this->productRepository->findWithoutFail($id);
     if (empty($product)) {
         Flash::error('Product not found');
         return redirect(route('products.index'));
     }
     $this->productRepository->delete($id);
     Flash::success('Product deleted successfully.');
     return redirect(route('products.index'));
 }
예제 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->productRepository->delete($id);
     Flash::info('Product deleted');
     return \Redirect::back();
 }