Skip to content

8. Laravel

Yohannes Mekonnen edited this page Oct 23, 2023 · 3 revisions

# Sending SMS to a Single Phone with Laravel

use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Content-Type' => 'application/json',
])->post('your_single_url', [
    'username' => 'your_username',
    'password' => 'your_password',
    'to' => '2519xxxxxxxxx',
    'text' => 'your_message',
]);

// Handle the Response

# Sending SMS to a Multiple Phone with Laravel

use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Content-Type' => 'application/json',
])->post('your_list_url', [
    'username' => 'your_username',
    'password' => 'your_password',
    'to' => ['2519xxxxxxxxx', '2519xxxxxxxxx', '2519xxxxxxxxx'],
    'text' => 'your_message',
]);

// Handle the Response
Clone this wiki locally