From 8cea1b663f8e446f1417a8870e78b2288feacf80 Mon Sep 17 00:00:00 2001 From: Jagad R R Date: Wed, 5 Mar 2025 13:47:57 +0700 Subject: [PATCH] Update WhatsappHelper.php --- app/Helpers/WhatsappHelper.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/app/Helpers/WhatsappHelper.php b/app/Helpers/WhatsappHelper.php index 0661815..fa6e2d0 100644 --- a/app/Helpers/WhatsappHelper.php +++ b/app/Helpers/WhatsappHelper.php @@ -8,15 +8,6 @@ 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(); @@ -48,9 +39,9 @@ class WhatsappHelper try { // Send the request to the WABLAS API - $response = $client->post(self::$wablasHost . '/api/v2/send-message', [ + $response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [ 'headers' => [ - 'Authorization' => self::$wablasToken, + 'Authorization' => env('WABLAS_TOKEN'), 'Content-Type' => 'application/json' ], 'json' => [ @@ -97,9 +88,9 @@ class WhatsappHelper try { // Send the request to the WABLAS API - $response = $client->post(self::$wablasHost . '/api/v2/send-message', [ + $response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [ 'headers' => [ - 'Authorization' => self::$wablasToken, + 'Authorization' => env('WABLAS_TOKEN'), 'Content-Type' => 'application/json' ], 'json' => [ @@ -146,9 +137,9 @@ class WhatsappHelper try { // Send the request to the WABLAS API - $response = $client->post(self::$wablasHost . '/api/v2/send-message', [ + $response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [ 'headers' => [ - 'Authorization' => self::$wablasToken, + 'Authorization' => env('WABLAS_TOKEN'), 'Content-Type' => 'application/json' ], 'json' => [ @@ -195,9 +186,9 @@ class WhatsappHelper try { // Send the request to the WABLAS API - $response = $client->post(self::$wablasHost . '/api/v2/send-message', [ + $response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [ 'headers' => [ - 'Authorization' => self::$wablasToken, + 'Authorization' => env('WABLAS_TOKEN'), 'Content-Type' => 'application/json' ], 'json' => [ @@ -244,9 +235,9 @@ class WhatsappHelper try { // Send the request to the WABLAS API - $response = $client->post(self::$wablasHost . '/api/v2/send-message', [ + $response = $client->post(env('WABLAS_HOST') . '/api/v2/send-message', [ 'headers' => [ - 'Authorization' => self::$wablasToken, + 'Authorization' => env('WABLAS_TOKEN'), 'Content-Type' => 'application/json' ], 'json' => [