/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     $route = Route::find($id);
     /*$invoice =  DB::table("invoices")->where("company_id","=",$id)->get();
     
             if(count($invoice)>0){
                 return response()->json("This Record cannot be deleted!<br>Bill Transactions is already existing against this company");
                 exit;
             }*/
     if ($route->delete()) {
         Session::flash("success_message", "Record Successfully deleted");
         echo "Route Successfully Deleted";
         exit;
     }
 }
Example #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $route = Route::find($id);
     $route->delete();
     Notification::success('Ruta eliminada correctamente');
     return redirect('routes');
 }