<?php

namespace App\Services;

use Illuminate\Support\Facades\Http;

class WaaService
{
    protected $apiUrl;
    protected $apiKey;

    public function __construct()
    {
        $this->apiUrl = env('WAA_API_URL');
        $this->apiKey = env('WAA_API_KEY');
    }

    public function sendWhatsAppMessage($to, $message)
    {
        $response = Http::post($this->apiUrl, [
            'api_key' => $this->apiKey,
            'phone' => $to,
            'message' => $message,
        ]);

        return $response->json();
    }
}
