PHPackages                             enio1910/laravel-smsapi-notification-channel - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. enio1910/laravel-smsapi-notification-channel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

enio1910/laravel-smsapi-notification-channel
============================================

A Laravel Notification Channel for SMSAPI

2.0.0(2mo ago)586↓50%MITPHPPHP ^8.3CI passing

Since Apr 2Pushed 2mo agoCompare

[ Source](https://github.com/ENIO1910/laravel-smsapi-notification-channel)[ Packagist](https://packagist.org/packages/enio1910/laravel-smsapi-notification-channel)[ Docs](https://github.com/ENIO1910/laravel-smsapi-notification-channel)[ RSS](/packages/enio1910-laravel-smsapi-notification-channel/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (5)Dependencies (18)Versions (7)Used By (0)

SMSAPI Notification Channel for Laravel
=======================================

[](#smsapi-notification-channel-for-laravel)

This package makes it easy to send SMS and MMS notifications using SMSAPI with Laravel 11, 12, and 13.

Installation
------------

[](#installation)

```
composer require enio1910/laravel-smsapi-notification-channel
```

If you are using Laravel without package auto-discovery, add the service provider to `config/app.php`:

```
'providers' => [
    NotificationChannels\SmsApi\SmsApiServiceProvider::class,
],
```

Publish the config:

```
php artisan vendor:publish --tag=smsapi-config
```

Configuration
-------------

[](#configuration)

Configure `config/smsapi.php`:

```
return [
    'service' => env('SMSAPI_SERVICE', 'pl'),
    'uri' => env('SMSAPI_URI'),
    'token' => env('SMSAPI_TOKEN'),
    'from' => env('SMSAPI_FROM'),
    'timeout' => (int) env('SMSAPI_TIMEOUT', 10),
];
```

Or set only `.env` values:

```
SMSAPI_SERVICE=pl
SMSAPI_URI=
SMSAPI_TOKEN=your-token
SMSAPI_FROM=YourBrand
SMSAPI_TIMEOUT=10
```

The package uses the official `smsapi/php-client` v3 adapter internally.

- `service=pl` uses `smsapiPlService()`
- `service=com` uses `smsapiComService()`
- if `uri` is set, the package uses the matching `*ServiceWithUri()` variant
- MMS sending is available only for `service=pl`, because the official SMSAPI client exposes `mmsFeature()` only there

Response DTO
------------

[](#response-dto)

The channel returns `NotificationChannels\SmsApi\Dto\SmsApiResponse`.

For real SMSAPI sends the package maps the response returned by `smsapi/php-client` and normalizes it to:

- `statusCode`: local adapter status, currently `200` when the SMSAPI client accepted the send request
- `decoded.id`: SMS/MMS identifier
- `decoded.points`: charged points
- `decoded.number`: recipient number
- `decoded.status`: SMS/MMS status returned by SMSAPI
- `decoded.idx`: external identifier if present
- `decoded.date_sent`: ISO-8601 sent date if available

This is adapter-level data, not the raw HTTP response from SMSAPI.

Usage
-----

[](#usage)

```
use Illuminate\Notifications\Notification;
use NotificationChannels\SmsApi\SmsApiChannel;
use NotificationChannels\SmsApi\SmsApiMessage;

class InvoicePaid extends Notification
{
    public function via(object $notifiable): array
    {
        return [SmsApiChannel::class];
    }

    public function toSmsApi(object $notifiable): SmsApiMessage
    {
        return SmsApiMessage::create('Faktura została opłacona.');
    }
}
```

To send the notification, call `notify()` on your model:

```
$user->notify(new InvoicePaid());
```

The model you call `notify()` on must use the `Illuminate\Notifications\Notifiable` trait.

For on-demand notifications, you can use the channel class directly:

```
\Illuminate\Support\Facades\Notification::route(SmsApiChannel::class, '+48123123123')
    ->notify(new InvoicePaid());
```

Example:

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable
{
    use Notifiable;
}
```

If you do not pass the recipient directly with `to()`, you must define the recipient on the notifiable model:

```
use Illuminate\Notifications\Notification;

public function routeNotificationForSmsApi(?Notification $notification = null): string
{
    return $this->phone;
}
```

This method name is kept for compatibility. The package supports `SmsApiChannel::class` for `via()` and on-demand `Notification::route()`, while model-based routing still resolves through `routeNotificationForSmsApi()`.

In practice, a complete notifiable model can look like this:

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Notifications\Notification;

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForSmsApi(?Notification $notification = null): string
    {
        return $this->phone;
    }
}
```

Or provide the recipient directly in the message:

```
return SmsApiMessage::create('Faktura została opłacona.')
    ->to('+48123123123')
    ->from('MyBrand');
```

If you use `to()`, `routeNotificationForSmsApi()` is not required for that notification.

Bulk SMS Usage
--------------

[](#bulk-sms-usage)

To send one SMS to many recipients in a single SMSAPI request, use `toMany()`:

```
return SmsApiMessage::create('Faktura została opłacona.')
    ->toMany([
        '+48123123123',
        '+48999111222',
    ])
    ->from('MyBrand');
```

You can also return an array from `routeNotificationForSmsApi()`:

```
use Illuminate\Notifications\Notification;

public function routeNotificationForSmsApi(?Notification $notification = null): array
{
    return [
        '+48123123123',
        '+48999111222',
    ];
}
```

Bulk sending is available for SMS messages. MMS still requires a single recipient.

MMS Usage
---------

[](#mms-usage)

To send an MMS, switch the message to MMS mode with `mms($subject, $smil)`:

- The SMIL payload should use the `SMIL 1.0` standard.
- If the MMS references files by path or URL, that path must be publicly accessible.

```
use Illuminate\Notifications\Notification;
use NotificationChannels\SmsApi\SmsApiChannel;
use NotificationChannels\SmsApi\SmsApiMessage;

class InvoiceWithAttachment extends Notification
{
    public function via(object $notifiable): array
    {
        return [SmsApiChannel::class];
    }

    public function toSmsApi(object $notifiable): SmsApiMessage
    {
        return SmsApiMessage::create()
            ->mms('Invoice 2026/04', '')
            ->set('files[invoice.txt]', base64_encode('Invoice content'));
    }
}
```

You can still use `to()` to set the recipient explicitly:

```
return SmsApiMessage::create()
    ->to('+48123123123')
    ->mms('Invoice 2026/04', '')
    ->set('files[invoice.txt]', base64_encode('Invoice content'));
```

Any additional MMS-specific parameters supported by SMSAPI can be passed with `set($key, $value)`.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance86

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Every ~4 days

Total

6

Last Release

73d ago

Major Versions

v1.1.1 → 2.0.02026-04-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1fc65e2b501829a0cf0aa67014226073980640c1f86c160d242eb22a9b470ea?d=identicon)[ENIO1910](/maintainers/ENIO1910)

---

Top Contributors

[![ENIO1910](https://avatars.githubusercontent.com/u/63077435?v=4)](https://github.com/ENIO1910 "ENIO1910 (17 commits)")

###  Code Quality

TestsPest

Static AnalysisRector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/enio1910-laravel-smsapi-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/enio1910-laravel-smsapi-notification-channel/health.svg)](https://phpackages.com/packages/enio1910-laravel-smsapi-notification-channel)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M159](/packages/spatie-laravel-health)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4079.9M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/expo

Expo Notifications Channel for Laravel

67628.6k1](/packages/laravel-notification-channels-expo)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

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