NowSMS service provider for Laravel

1.1 2018-02-06 13:07 UTC

This package is not auto-updated.

Last update: 2021-05-08 15:59:12 UTC


This package makes it easy to send NowSMS notifications with Laravel.

Total Downloads Latest Version License


Require this package, with Composer, in the root directory of your project.

$ composer require junityco/laravel-nowsms

Add the service provider to config/app.php in the providers array.


If you want you can use the facade. Add the reference in config/app.php to your aliases array.

'NowSms' => Junity\NowSms\Facades\NowSms::class

You will also need to install guzzlehttp/guzzle http client to send requests.

Setting up your NowSMS account

Add your NowSMS url, username, password config/services.php:

// config/services.php
'nowsms' => [
    'url' => '',
    'username' => '',
    'password' => '',


Now you can use the channel in your via() method inside the notification:

use Junity\NowSms\Messages\SmsMessage;
use Junity\NowSms\Channels\NowSmsChannel;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
    public function via($notifiable)
        return [NowSmsChannel::class];

    public function toNowSms($notifiable)
        return (new SmsMessage)
            ->content("Your account was approved!");

In order to let your Notification know which phone are you sending/calling to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForNowsms method to your Notifiable model.

public function routeNotificationForNowsms()
    return '+1234567890';

Example using via code

use Junity\NowSms\Facades\NowSms;

    'Text' => 'Some text',
    'Sender' => 'MyApp',
], '+1234567890');