Files
nuhodds_fi4/app/Console/Commands/Grapper/Logifuture.php
T
2026-01-05 16:23:14 +01:00

71 lines
2.1 KiB
PHP

<?php
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\Logifuture\Auth;
use App\Console\Commands\Grapper\Logifuture\BaseUrl;
use App\Console\Commands\Nuh;
use App\Models\Sport;
use App\Utilities\Notice;
class Logifuture
{
public static function switch()
{
$debug = Nuh::$options['d'] ?? 0;
$sportmap = Sport::map('logi', 1, [1, 2, 3, 5]);
if ($debug) {
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['sport']['name'], 'g');
}
switch (Nuh::$options['provider_id']) {
case 5:
Nuh::$options['bookmaker_id'] = 35;
break;
case 6:
Nuh::$options['bookmaker_id'] = 36;
break;
}
$data = Auth::exe();
foreach ($sportmap as $client_sportid => $sportid) {
$post_fields = [
'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sportid,
'header' => json_encode(['Authorization: Bearer '.$data['token'], 'accept: application/json', 'content-type: application/json']),
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://proxydb1.nuhodds.com/logifuture.php');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx',
]);
$file = curl_exec($ch);
dd($file);
$data = json_decode($file, true);
dd($data);
}
}
}
$header = [];
$header[] = 'Authorization: Bearer '.$data['token'];
$header[] = 'accept: application/json';
$header[] = 'content-type: application/json';
return $header;