sushantaryal / sparrow-notification-channel
Sparrow SMS Notification Channel for laravel.
1.0.0
2025-05-14 13:30 UTC
Requires
- php: ^8.0
- illuminate/notifications: ^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.2
- mockery/mockery: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.0|^10.4|^11.5
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.