update revisi

This commit is contained in:
Jagad R R
2025-03-05 13:44:58 +07:00
parent 278fc3741d
commit ee3de88659
18 changed files with 673 additions and 121 deletions
+19 -10
View File
@@ -8,6 +8,15 @@ use Illuminate\Support\Str;
class WhatsappHelper
{
protected $wablasHost;
protected $wablasToken;
public function __construct()
{
self::$wablasHost = env('WABLAS_HOST');
self::$wablasToken = env('WABLAS_TOKEN');
}
public static function approveExpense($phones, $expense_number, $url = null, $tanggal, $total, $name)
{
$client = new Client();
@@ -39,9 +48,9 @@ class WhatsappHelper
try {
// Send the request to the WABLAS API
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
$response = $client->post(self::$wablasHost . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Authorization' => self::$wablasToken,
'Content-Type' => 'application/json'
],
'json' => [
@@ -88,9 +97,9 @@ class WhatsappHelper
try {
// Send the request to the WABLAS API
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
$response = $client->post(self::$wablasHost . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Authorization' => self::$wablasToken,
'Content-Type' => 'application/json'
],
'json' => [
@@ -137,9 +146,9 @@ class WhatsappHelper
try {
// Send the request to the WABLAS API
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
$response = $client->post(self::$wablasHost . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Authorization' => self::$wablasToken,
'Content-Type' => 'application/json'
],
'json' => [
@@ -186,9 +195,9 @@ class WhatsappHelper
try {
// Send the request to the WABLAS API
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
$response = $client->post(self::$wablasHost . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Authorization' => self::$wablasToken,
'Content-Type' => 'application/json'
],
'json' => [
@@ -235,9 +244,9 @@ class WhatsappHelper
try {
// Send the request to the WABLAS API
$response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [
$response = $client->post(self::$wablasHost . '/api/v2/send-message', [
'headers' => [
'Authorization' => env('WABLAS_TOKEN'),
'Authorization' => self::$wablasToken,
'Content-Type' => 'application/json'
],
'json' => [