Initial commit
This commit is contained in:
33
app/Libs/Ntfysender.php
Normal file
33
app/Libs/Ntfysender.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user