diff --git a/app/Http/Controllers/PilotIvaoController.php b/app/Http/Controllers/PilotIvaoController.php index fa3a909..4584e42 100644 --- a/app/Http/Controllers/PilotIvaoController.php +++ b/app/Http/Controllers/PilotIvaoController.php @@ -21,9 +21,10 @@ public function getApideparturePilot($icao) $api = $this->whazzup(); $count = $api["connections"]["pilot"]; $pilot = $api["clients"]["pilots"]; + //dd($pilot[0]["flightPlan"]["departureId"]); $pilotDeparture = []; for ($i = 0; $i <= $count; $i++) { - foreach ($pilot as $key => $value) { + foreach ($pilot as $i => $value) { if ($value["flightPlan"]["departureId"] == $icao) { array_push($pilotDeparture, $value); } @@ -39,7 +40,7 @@ public function getApiArrivalPilot($icao) $pilot = $api["clients"]["pilots"]; $PilotArrival = []; for ($i = 0; $i <= $count; $i++) { - foreach ($pilot as $key => $value) { + foreach ($pilot as $i => $value) { if ($value["flightPlan"]["arrivalId"] == $icao) { array_push($PilotArrival, $value); }