From d5117a1b18545882d7527e84e14c14c0b0d35b66 Mon Sep 17 00:00:00 2001 From: alexcaussades Date: Sun, 14 Apr 2024 09:15:15 +0200 Subject: [PATCH 1/2] resolve pilots ivao (#153) --- app/Http/Controllers/PilotIvaoController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } From f4bfd73eb64a2edb710d2f70b0afaa0a2a0cd08f Mon Sep 17 00:00:00 2001 From: alexcaussades Date: Sun, 14 Apr 2024 09:42:18 +0200 Subject: [PATCH 2/2] Feeback (#156) * resolve pilots ivao * feedback --- routes/web.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index ba8204d..d17ccc9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Mail; use Monolog\Formatter\JsonFormatter; +use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Route; use App\Http\Controllers\AtcController; use Illuminate\Support\Facades\Session; @@ -602,13 +603,14 @@ Route::post("create", function (Request $request) { $github = new GithubController(); + // dd($request); + // $request->merge([ + // "user_id" => Auth::user()->id ?? null, + // "body" => $request->body, + // "link" => $github, + // "label" => $request->label + // ]); $github = $github->send_issue($request); - $request->merge([ - "user_id" => Auth::user()->id ?? null, - "body" => $request->body, - "link" => $github, - "label" => $request->label - ]); $discord = new DiscordContoller(); $discord->send_feedback($request); return to_route("feedback.index")->with("success", "Votre feedback à été envoyé !"); @@ -670,4 +672,10 @@ return $event_world; })->name("event.index"); + + Route::get("crypt", function (Request $request) { + $encrypted = Crypt::encryptString('la vie de devs est cool.'); + $decrypted = Crypt::decryptString("eyJpdiI6Ik94UDRsMlR4NGRSWHVjazljTXJhQVE9PSIsInZhbHVlIjoiWlZWdGNNdXZabDFlTGQrLzRTVytwejFtV25MRGVibk1IUXB2bDZwVEF2ST0iLCJtYWMiOiJkZmVkOTNhZWM2NmY2MTEyNjhjYjYyMDZiN2FjM2I3MmMwZjY3ZGNiNTJjOTVmOGZiMjRlM2Q3ODE3NTU2ZDQ1IiwidGFnIjoiIn0="); + dd($decrypted); + })->name("crypto"); });