Ejemplo n.º 1
0
 public function destroy($id)
 {
     $voucher = Voucher::with('reductions')->find($id);
     if ($voucher->reductions->count() > 0) {
         Session::flash('message', 'Tidak bisa menghapus Voucher. Voucher ini telah digunakan!');
     } else {
         Voucher::destroy($id);
         Session::flash('message', 'Sukses menghapus voucher');
     }
 }
Ejemplo n.º 2
0
 /**
  * Remove the specified voucher from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Voucher::destroy($id);
     return Redirect::route('vouchers.index');
 }