initial project
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries;
|
||||
|
||||
class Wato {
|
||||
|
||||
protected $api_url;
|
||||
protected $api_key;
|
||||
protected $company;
|
||||
|
||||
public function __construct() {
|
||||
$this->api_url = defined('WATOAPILINK') ? WATOAPILINK : '';
|
||||
$this->api_key = defined('WATOAPIKEY') ? WATOAPIKEY : '';
|
||||
$this->company = defined('COMPANY') ? COMPANY : 'Company';
|
||||
helper("general");
|
||||
}
|
||||
|
||||
public function pushNotification($mobile, $message) {
|
||||
$mobile = str_replace('+', '', $mobile);
|
||||
$postFields = [
|
||||
'token' => $this->api_key,
|
||||
'to' => $mobile,
|
||||
'message' => $message
|
||||
];
|
||||
|
||||
return send_api_request('POST', $this->api_url, [], $postFields);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user