initial commit

This commit is contained in:
2026-06-29 13:00:18 +06:00
commit f2aea74471
3931 changed files with 562423 additions and 0 deletions

47
app/Utility/Curl.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
namespace App\Utility;
use Illuminate\Support\Facades\Http;
class Curl
{
private array $prepareData;
private static string $url;
private static array $header;
public function __construct($url,$header = ['Content-Type: application/json']){
static::$url = $url;
static::$header = $header;
}
private function prepareRequest($inputData){
return $inputData;
}
public function post($request){
$this->prepareData = $this->prepareRequest($request);
$response = Http::withHeaders(static::$header)
->post(
static::$url,
$this->prepareData
);
return json_decode((string) $response->getBody(), true);
}
public function get($request){
$this->prepareData = $this->prepareRequest($request);
$response = Http::withHeaders(static::$header)
->get(
static::$url,
$this->prepareData
);
return json_decode((string) $response->getBody(), true);
}
}