PHPackages                             thepublicgood/smsportal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. thepublicgood/smsportal

ActiveLibrary[HTTP &amp; Networking](/categories/http)

thepublicgood/smsportal
=======================

SMSPortal client for Laravel

v0.0.1(3y ago)1189MITPHPPHP ^8.1

Since Apr 18Pushed 3y ago2 watchersCompare

[ Source](https://github.com/tpg/smsportal)[ Packagist](https://packagist.org/packages/thepublicgood/smsportal)[ RSS](/packages/thepublicgood-smsportal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

SMSPortal client for Laravel
============================

[](#smsportal-client-for-laravel)

[![Tests](https://github.com/tpg/smsportal/actions/workflows/tests.yml/badge.svg)](https://github.com/tpg/smsportal/actions/workflows/tests.yml)

This library provides a complete implementation of the SMSPortal Rest API for Laravel. The library provides a generic client you can use to send SMSs and a Laravel Notifications Channel which can be used to easily send SMSs to specific entities.

Installation through Composer:

```
composer require thepublicgood/smsportal
```

Once installed, publish the config file with:

```
php ./artisan vendor:publish --provider="TPG\\SMSPortal\\SMSPortalServiceProvider"
```

This will place a simple `smsportal.php` file in your config directory. However, if you don't want to publish the provided config file, you can also alter the provided `services.php` config file with:

```
return [

    //...

    'smsportal' => [
        'id' => env('SMSPORTAL_ID'),
        'secret' => env('SMSPORTAL_SECRET'),
    ],

];
```

Configure your SMSPortal API ID and Secret in either the `services.php` or `smsportal.php` config file.

Basic usage
-----------

[](#basic-usage)

The library provides a Laravel facade to easily send arbitrary messages to one or more mobile numbers:

```
SMSPortal::to('27823456789')->message('Hello, World!')->send();
```

You can also send the same message to multiple numbers by passing in an array:

```
SMSPortal::to(['27823456789', '278209876543'])->message('Hello, all of you!')->send();
```

Advanced usage
--------------

[](#advanced-usage)

If you need more control over who received what, the library has registered the `SMSPortalClient` interface into the Laravel container. You can create `Message` objects and pass them to the `sendBulk` method:

```
use TPG\SMSPortal\Contracts\SMSPortalClient;
use TPG\SMSPortal\Message;

public function sms(SMSPortalClient $client)
{
    $message1 = new Message('27823456789', 'Message number 1');
    $message2 = new Message('27829876543', 'Message number 2');

    $response = $client->sendBulk([$message1, $message2]);
}
```

You can also use the `send` message to send a single message:

```
$response = $client->send($message);
```

SMSPortal groups
----------------

[](#smsportal-groups)

If you've set up groups on contacts through SMSPortal, you can send a single message to the groups your choice by using the `sendGroup` method:

```
use TPG\SMSPortal\Contracts\SMSPortalClient;
use TPG\SMSPortal\Message;

public function sms(SMSPortalClient $client)
{
    $response = $client->sendGroup('Hello, all of you groups!', ['group1', 'group2']);
}
```

Laravel Notifications
---------------------

[](#laravel-notifications)

If you want to use SMSPortal through Laravel Notifications, create a new `Notification` class and add `smsportal` to the array returned by the `via` method:

```
use TPG\SMSPortal\SMSPortalChannel;

public function via($notifiable): array
{
    return [
        'smsportal',
    ]
}
```

Then define a `toSMSPortal` method on the notification and return a message `string`:

```
public function toSMSPortal($notifiable): string
{
    'Hello, '.$notifiable->name;
}
```

On the notifiable class (your `User` class, for example) define a `routeNotificationForSMSPortal` method that returns the correct mobile number to send to:

```
public function routeNotificationForSmsPortal(Notification $notification): string
{
    return $this->mobile;
}
```

Sending options
---------------

[](#sending-options)

The library also provides a way to pass SMSPortal sending options. You can create a new instance of `SendOptions` and pass in any option you need. Pass this as the last parameter of the `send`, `sendBulk` or `sendGroup` methods:

```
use TPG\SMSPortal\Contracts\SMSPortalClient;
use TPG\SMSPortal\Message;

public function sms(SMSPortalClient $client)
{
    $options = new SendOptions(
        allowContentTrimming: true,
        shortenUrls: true,
    );

    $response = $client->send($message, $options);
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89ea2dc12cd0a934de60705f8cfe47397095d842121b7d5f545dc9d1cee554ec?d=identicon)[warrickbayman](/maintainers/warrickbayman)

---

Top Contributors

[![warrickbayman](https://avatars.githubusercontent.com/u/856840?v=4)](https://github.com/warrickbayman "warrickbayman (7 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/thepublicgood-smsportal/health.svg)

```
[![Health](https://phpackages.com/badges/thepublicgood-smsportal/health.svg)](https://phpackages.com/packages/thepublicgood-smsportal)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[behamin/service-proxy

for proxy or sending requests to other services with useful utilities

102.2k](/packages/behamin-service-proxy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
