33 lines
777 B
PHP
33 lines
777 B
PHP
<?php
|
|
|
|
namespace App\Libs;
|
|
|
|
use Config;
|
|
use Log;
|
|
use App;
|
|
class Ntfysender {
|
|
|
|
function sendNtfy($data){
|
|
$url = 'https://ntfy.sh/airtimeSalesPortal';
|
|
$curl = curl_init();
|
|
curl_setopt_array($curl, array(
|
|
CURLOPT_HTTPHEADER => array(
|
|
'Content-Type: application/json'
|
|
),
|
|
CURLOPT_URL => $url,
|
|
CURLOPT_RETURNTRANSFER => true,
|
|
CURLOPT_ENCODING => '',
|
|
CURLOPT_MAXREDIRS => 10,
|
|
CURLOPT_TIMEOUT => 0,
|
|
CURLOPT_FOLLOWLOCATION => true,
|
|
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
CURLOPT_CUSTOMREQUEST => 'POST',
|
|
CURLOPT_POSTFIELDS => $data
|
|
));
|
|
$response = curl_exec($curl);
|
|
return $response;
|
|
}
|
|
|
|
|
|
}
|
|
?>
|