/**
  * Remove the specified outlet from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $outlets = Outlet::where('retailer_id', $id)->get();
     Outlet::destroy($outlets);
     Retailer::destroy($id);
     return Redirect::route('admin.retailers.index');
 }
示例#2
0
 /**
  * Remove the specified outlet from storage.
  *
  * @return Response
  */
 public function destroy()
 {
     $id = Input::get('id');
     if (Outlet::destroy($id)) {
         echo json_encode(array('code' => 0, 'messages' => Lang::get('site/outlets/messages.delete.success')));
     } else {
         echo json_encode(array('code' => 1, 'messages' => Lang::get('site/outlets/messages.delete.error')));
     }
 }