Files
nuhodds_fi4/app/Utilities/Guzzle.php
T
2025-08-14 16:05:36 +02:00

26 lines
538 B
PHP

<?php
namespace App\Utilities;
use Exception;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Facades\Http;
class Guzzle
{
public static function load($url, $debug = 0)
{
BetsapiCounter::count($debug);
if ($debug) {
Notice::note($url, 'g');
}
$data = Http::retry(3, 2, function (Exception $exception, PendingRequest $request) {
return $exception instanceof ConnectionException;
})->get($url);
return json_decode($data, true);
}
}