# Send SMS with Laravel | VeloBotix

> Laravel HTTP client example for VeloBotix SEND_SINGLE with Basic Auth.

Source: https://www.velobotix.app/docs/laravel

Languages

# Laravel

## Prerequisites

A Laravel app with Http facade available. Store VELOBOTIX\_EMAIL and VELOBOTIX\_API\_KEY in .env — never commit secrets.

## Authentication

Use ->withBasicAuth($email, $apiKey) on the HTTP client.

## SEND\_SINGLE example

Equivalent to the documented curl POST:

```
use Illuminate\Support\Facades\Http;

$response = Http::withBasicAuth(
        env('VELOBOTIX_EMAIL'),
        env('VELOBOTIX_API_KEY')
    )
    ->acceptJson()
    ->post('https://portal.velobotix.app/api.php?FUN=SEND_SINGLE', [
        'senderID' => 'VeloBotix',
        'to'       => '0701234567',
        'msg'      => 'Your OTP is 483920. Valid for 5 minutes.',
    ]);

$status = $response->status();
$body = $response->body();
```

## Common mistakes

Calling the gateway from a public controller without auth on your own route.

Missing FUN=SEND\_SINGLE on the URL.

Using config values that were never loaded after .env changes (run config:clear in local).

## Create account

Sign up in the portal and get your API key — username is your email, password is the key.

[Open portal — get API key](https://portal.velobotix.app)
