Developer Release

WebSMS Laravel Package: Send SMS from Laravel in Three Lines

composer require websms-nz/laravel-websms

We've shipped an official Composer package for Laravel that wraps the WebSMS Connexus API. It supports Laravel 10, 11 and 12, requires PHP 8.1+, and is MIT licensed. Two values in .env, one Composer command, and you're sending.

The full documentation lives on the Laravel integration page. The source is on GitLab and the package is published on Packagist.

What's in the box

Send SMS

WebSms::send($to, $body) from any controller, job or queued worker. NZ and AU local formats are normalised automatically.

OTP / 2FA codes

WebSms::otp()->send($to) generates and sends a code, then returns it so you can persist it for verification.

Templated appointment reminders

WebSms::appointment()->send(...) renders server-side at the templated $0.08 + GST per part rate. Pass only the fields you want included.

Notification channel

Any Notifiable can receive SMS via ->via('websms'). Implement toWebSms() returning a WebSmsMessage.

Inbound webhook + events

Mount one controller, listen for WebSmsMessageReceived (replies) and WebSmsDeliveryReportReceived (DLR) events anywhere in your app.

Idiomatic Laravel

Auto-discovered service provider, facade alias, publishable config, Artisan websms:test command. Works the way Laravel devs already expect.

Three lines, one SMS

After running composer require websms-nz/laravel-websms and adding two values to your .env:

WEBSMS_CLIENT_ID=your_client_id
WEBSMS_CLIENT_SECRET=your_client_secret

…send your first SMS from anywhere in the app:

use WebSms;

WebSms::send('+64211234567', 'Hello from Laravel.');

OTP / 2FA in one call

WebSMS generates the code, sends it, and returns it so you can persist it for verification:

$res = WebSms::otp()->send('+64211234567');
session(['otp_code' => $res['code']]);

Receive replies and delivery reports as Laravel events

Mount the bundled controller in routes/web.php, paste the URL into the API Keys page in the WebSMS members area, and listen anywhere:

use WebSmsNz\Laravel\Events\WebSmsMessageReceived;

Event::listen(WebSmsMessageReceived::class, function ($event) {
    Log::info("Reply from {$event->from}: {$event->body}");
});

Or generate a queued listener with php artisan make:listener so heavy work happens off the webhook response thread.

Why we built it

A lot of New Zealand and Australian businesses run their back office on Laravel — clinics, trades operations, agencies, e-commerce. Sending SMS from Laravel was already possible via raw Http::post(...) calls against the Connexus API, but every team ended up writing the same thin wrapper: token caching, phone number normalisation, a notification channel, an OTP helper. Shipping the package once removes that repetition for everyone.

The package is intentionally small — a focused wrapper around the API and the idiomatic Laravel touchpoints (facade, notification channel, events). It doesn't try to be an SMS framework or hide the underlying API; if you need something the package doesn't expose, the raw Connexus API is one HTTP call away.

Get it now

composer require websms-nz/laravel-websms