app/Http/Controllers/Create_tripController.php
//if delete the trip then information regarding trip must have to delete.
if delete the trip then information regarding trip must have to delete.
if delete the trip then information regarding trip must have to delete .
public function delete($id,Request $request)
   {
    $api_token=$request->api_token;
    if($trip_organiser=User::where('api_token','=',$api_token)->where('type','=','trip organiser')->get('email'))
    { 
        if($trip_organiser==Trip::where('trip_id','=',$id)->get('trip_org_email')){
        $trip=Trip::where('trip_id','=',$id)->delete();
        return response("TRIP DELETED ",200);
    }
    return response("MISMATCH",401);
    }
    return response("YOU DON'T HAVE PROPER PERMISSION",401);
   }
public function delete ( $ id , Request $ request ) { $ api_token = $ request -> api_token ; if ( $ trip_organiser = User :: where ( 'api_token' , '=' , $ api_token ) -> where ( 'type' , '=' , 'trip organiser' ) -> get ( 'email' ) ) { if ( $ trip_organiser == Trip :: where ( 'trip_id' , '=' , $ id ) -> get ( 'trip_org_email' ) ) { $ trip = Trip :: where ( 'trip_id' , '=' , $ id ) -> delete ( ) ; return response ( " TRIP DELETED  " , 200 ) ; } return response ( " MISMATCH " , 401 ) ; } return response ( " YOU DON'T HAVE PROPER PERMISSION " , 401 ) ; }
if delete the trip then information regarding trip must have to delete.
if delete the trip then information regarding trip must have to delete .