PHPackages                             abdulmatinsanni/api-x - 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. [API Development](/categories/api)
4. /
5. abdulmatinsanni/api-x

ActiveLibrary[API Development](/categories/api)

abdulmatinsanni/api-x
=====================

An unofficial laravel package for SmartSMSSolutions' APIx. The Package that helps deliver SMS to phone numbers on Do Not Disturb (DND).

1.2.0(7y ago)249MITPHPPHP ~5.6|~7.0

Since Jun 6Pushed 3y agoCompare

[ Source](https://github.com/abdulmatinsannl/api-x)[ Packagist](https://packagist.org/packages/abdulmatinsanni/api-x)[ Docs](https://github.com/AbdulmatinSanni/APIx)[ RSS](/packages/abdulmatinsanni-api-x/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (4)Used By (0)

api-x
=====

[](#api-x)

[![Latest Version on Packagist](https://camo.githubusercontent.com/95e2f0ebdfaa020ff1493df4a85ed6c5da90196b7cb975509b54ed014ae1c00d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264756c6d6174696e73616e6e692f6170692d782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abdulmatinsanni/api-x)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/025d988a66db6d989d3dcd22f75fd4ac15f312ce7e33888c5a29daf652d9c932/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616264756c6d6174696e73616e6e692f6170692d782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abdulmatinsanni/api-x)

An unofficial laravel package for SmartSMSSolutions' API-x. The Package that helps deliver SMS to phone numbers on Do Not Disturb (DND).

Structure
---------

[](#structure)

Below is the file structure of this package.

```
\---src
    |   APIx.php
    |   APIxMessage.php
    |   APIxServiceProvider.php
    |
    +---Channels
    |       SmartSMSChannel.php
    |
    +---Commands
    |   \---Log
    |           ClearCommand.php
    |           DisplayCommand.php
    |
    +---config
    |       api-x.php
    |
    +---Controllers
    |       LogController.php
    |
    +---Exceptions
    |       CouldNotSendNotification.php
    |       InvalidConfiguration.php
    |
    +---Facades
    |       APIxFacade.php
    |
    \---resources
        \---views
                log.blade.php

```

Install
-------

[](#install)

You can install the package via composer:

```
$ composer require abdulmatinsanni/api-x
```

Add the service provider (only required on Laravel 5.4 or lower):

```
// config/app.php

'providers' => [
    ...
    AbdulmatinSanni\APIx\APIxServiceProvider::class,
],

'aliases' => [
    'APIx' => AbdulmatinSanni\APIx\Facades\APIxFacade::class,
],
```

Setting up your API-x account
-----------------------------

[](#setting-up-your-api-x-account)

Add your API-x API Token (string), Log Message (boolean), Mock SMS (boolean) and Sender Name (optional|string) to your .env (environment) file:

```
SMARTSMSSOLUTIONS_API_TOKEN=apixtokenhere
SMARTSMSSOLUTIONS_LOG_MESSAGES=true
SMARTSMSSOLUTIONS_FAKE_SMS=true
SMARTSMSSOLUTIONS_SENDER_NAME=sendernamehere

```

Usage
-----

[](#usage)

### In Controllers:

[](#in-controllers)

Below is an example of API-x usage in controllers.

```
...

use APIx;

class SMSController extends Controller
{
    public function send(Request $request)
    {
        $response = APIx::to($request->recipient)
            ->from($request->name)
            ->message($request->message)
            ->send();

        return $response;
    }
}
```

### For Notifications:

[](#for-notifications)

#### Setting up in model:

[](#setting-up-in-model)

```
...

class User extends Model
{
    use Notifiable;

    public function routeNotificationForSmartSMS($notification)
    {
        return $this->phone_column;
    }
}
```

#### Setting up in notifications

[](#setting-up-in-notifications)

```
...

use AbdulmatinSanni\APIx\APIxMessage;
use AbdulmatinSanni\APIx\Channels\SmartSMSChannel;

class DemoNotification extends Notification
{
    use Queueable;

    ...

    public function via($notifiable)
    {
        return [SmartSMSChannel::class];
    }

    ...

    public function toSmartSMS($notifiable)
    {
        return (new APIxMessage())
                    ->from($this->from)
                    ->message($this->message);
    }
}
```

#### Setting up in controllers

[](#setting-up-in-controllers)

```
...

public class NotificationsController extends Controller
{
    public function notify()
    {
        $user = User::firstOrFail();
        $user->notify(new DemoNotification("SarahFound", "Hi, you are invited to our seminar!!!!!"));
    }
}
```

#### Available message methods

[](#available-message-methods)

- `to([]) `: Accepts an array or string of recipients' phone number(s).
- `from('') `: Accepts a phone to use as the sms sender.
- `message('') `: Accepts a string value for the sms body.
- `send() `: Does the sending of the sms. Can also accept a string which represent sms body if message('') was skipped.

### Command line

[](#command-line)

Showing all entries of log:

```
$ php artisan api-x:log
```

Showing the last logged sms:

```
$ php artisan api-x:log --latest
```

Limiting the entries of log to be displayed:

```
$ php artisan api-x:log --limit={no_of_messages}
```

Clearing all entries of log:

```
$ php artisan api-x:log clear
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test (NOT YET)
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Abdulmatin Sanni](https://github.com/https://github.com/abdulmatinsanni)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~93 days

Total

3

Last Release

2709d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96153a266dbbb347e464bc4a4a685d8fc61bf1e96fe8d595a054883deefb000d?d=identicon)[abdulmatinsanni](/maintainers/abdulmatinsanni)

---

Top Contributors

[![abdulmatinsannl](https://avatars.githubusercontent.com/u/131744044?v=4)](https://github.com/abdulmatinsannl "abdulmatinsannl (25 commits)")

---

Tags

laravelsmsapixAbdulmatinSanni

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/abdulmatinsanni-api-x/health.svg)

```
[![Health](https://phpackages.com/badges/abdulmatinsanni-api-x/health.svg)](https://phpackages.com/packages/abdulmatinsanni-api-x)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)

PHPackages © 2026

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