Files
ilycats/app/Helpers/WhatsappHelper.php
T

20 lines
515 B
PHP
Raw Normal View History

2026-02-08 15:16:35 +07:00
<?php
namespace App\Helpers;
class WhatsappHelper
{
public static function send($target, $message)
{
$token = "YOUR_API_TOKEN";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.fonnte.com/send',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => ['target' => $target, 'message' => $message],
CURLOPT_HTTPHEADER => ["Authorization: $token"],
]);
curl_exec($curl);
curl_close($curl);
}
}