From d11882ddbacc124937c511422f233b27b46b930f Mon Sep 17 00:00:00 2001 From: salam Date: Thu, 15 Jan 2026 13:03:29 +0100 Subject: [PATCH] wip --- .../Grapper/Logifuture/Authentication.php | 2 -- .../Grapper/Logifuture/LogifutureData.php | 18 +++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/Grapper/Logifuture/Authentication.php b/app/Console/Commands/Grapper/Logifuture/Authentication.php index f2a5edac..d448b442 100644 --- a/app/Console/Commands/Grapper/Logifuture/Authentication.php +++ b/app/Console/Commands/Grapper/Logifuture/Authentication.php @@ -63,8 +63,6 @@ class Authentication $file = curl_exec($ch); - echo $file; - $data = json_decode($file, true); $header = []; diff --git a/app/Console/Commands/Grapper/Logifuture/LogifutureData.php b/app/Console/Commands/Grapper/Logifuture/LogifutureData.php index 8b3c5147..10b2b267 100644 --- a/app/Console/Commands/Grapper/Logifuture/LogifutureData.php +++ b/app/Console/Commands/Grapper/Logifuture/LogifutureData.php @@ -49,23 +49,19 @@ class LogifutureData } $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_URL, $_POST['url']); + curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ - 'username' => 'nuhodds', - 'password' => self::$password, - ])); - curl_setopt($ch, CURLOPT_HTTPHEADER, [ - 'accept: application/json', - 'content-type: application/json', - ]); + curl_setopt($ch, CURLOPT_HTTPHEADER, Logifuture::$auth_header); } + $file = curl_exec($ch); - dd($file); + if (curl_errno($ch)) { + echo curl_error($ch); + } return json_decode($file, true); }