sushantaryal/sparrow-notification-channel

Sparrow SMS Notification Channel for laravel.

1.0.0 2025-05-14 13:30 UTC

This package is auto-updated.

Last update: 2025-05-14 13:35:20 UTC


README

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\Notifications\SparrowSms\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\Notifications\SparrowSms\Messages\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.