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

1.2.0 2018-12-09 00:46 UTC


Latest Version on Packagist Software License Total Downloads

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


Below is the file structure of this package.

    |   APIx.php
    |   APIxMessage.php
    |   APIxServiceProvider.php
    |       SmartSMSChannel.php
    |   \---Log
    |           ClearCommand.php
    |           DisplayCommand.php
    |       api-x.php
    |       LogController.php
    |       CouldNotSendNotification.php
    |       InvalidConfiguration.php
    |       APIxFacade.php


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' => [

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

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:



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)
        return $response;

For Notifications:

Setting up in model:


class User extends Model
    use Notifiable;

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

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())

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

  • 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

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

Please see CHANGELOG for more information on what has changed recently.


$ composer test (NOT YET)


Please see CONTRIBUTING and CODE_OF_CONDUCT for details.


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



The MIT License (MIT). Please see License File for more information.