TKK_E32231899/app/Services/WhatsAppNotifier.php

20 lines
444 B
PHP

<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
class WhatsAppNotifier
{
public function send(string $message)
{
$response = Http::withHeaders([
'Authorization' => config('services.fonnte.token'),
])->post('https://api.fonnte.com/send', [
'target' => config('services.fonnte.target'),
'message' => $message,
]);
return $response->json();
}
}