LaravelPackages.net
Acme Inc.
Toggle sidebar
sushantaryal/sparrow-notification-channel

Sparrow SMS Notification Channel for laravel.

4
0
1.1.2
About sushantaryal/sparrow-notification-channel

sushantaryal/sparrow-notification-channel is a Laravel package for sparrow sms notification channel for laravel.. It currently has 0 GitHub stars and 4 downloads on Packagist (latest version 1.1.2). Install it with composer require sushantaryal/sparrow-notification-channel. Discover more Laravel packages by sushantaryal or browse all Laravel packages to compare alternatives.

Last updated

Sparrow SMS notifications channel for Laravel

Installation

You can install the package via Composer:

$ composer require sushantaryal/sparrow-notification-channel

Configuration

Add your Sparrow Token, and From identity to your .env:

SPARROW_SMS_TOKEN=ABCD #always required
SPARROW_SMS_FROM=identity #always required

Advanced configuration

Run

php artisan vendor:publish --provider="Sushant\SparrowSmsNotification\SparrowSmsServiceProvider"
/config/sparrow-sms.php

Usage

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

use Illuminate\Notifications\Notification;
use Sushant\SparrowSmsNotification\SparrowMessage;

class VerifyOtp extends Notification
{
    public function via($notifiable)
    {
        return ['sparrowsms'];
    }

    public function toSparrowSms($notifiable)
    {
        return (new SparrowMessage)
            ->content('Your OTP code is 12345.');
    }
}

Available Message methods

SparrowMessage

  • from(''): Accepts a identity provided to you.
  • content(''): Accepts a string value for the notification body.configuration.

License

Sparrow SMS notifications channel is open-sourced software licensed under the MIT license.

Comments