You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
651 B
33 lines
651 B
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Helpers;
|
||
|
|
||
|
|
||
|
class MasterFunctionsHelper {
|
||
|
|
||
|
|
||
|
public static function curlReq($url, $token = ""){
|
||
|
if(!$token)
|
||
|
$token = config('api.adw_token');
|
||
|
|
||
|
$ch = curl_init();
|
||
|
|
||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||
|
$headers = [
|
||
|
'Authorization: '.$token
|
||
|
];
|
||
|
|
||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||
|
curl_setopt($ch, CURLOPT_VERBOSE, true);
|
||
|
curl_setopt($ch, CURLOPT_STDERR, fopen('php://stderr', 'w'));
|
||
|
|
||
|
$output = curl_exec($ch);
|
||
|
curl_close($ch);
|
||
|
|
||
|
return json_decode($output);
|
||
|
}
|
||
|
|
||
|
}
|