procionegobbo / l9-smsapi-notification-channel
SMSAPI notification channel for Laravel 8/9
Requires
- php: >=8.0
- illuminate/notifications: ~8.0|~9.0
- illuminate/support: ~8.0|~9.0
- smsapi/php-client: ^3.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2023-03-14 17:00:06 UTC
README
This package makes it easy to send notifications using SMSAPI with Laravel 9.x
Easy to use notification channel for Laravel 9.x.
$user->notify(new TestSms('This is a test message'));
Contents
Installation
composer require fitprime/l9-smsapi-notification-channel
Create an account on SMSAPI and get your API token. Put your api key in the .env file in the root directory of your application.
SMSAPI_AUTH_TOKEN=<your_auth_token>
Setting up the L9SmsApi service
If you needs to change the default setting for your app you must publish the configuration file.
Usage
Send a message
use Illuminate\Notifications\Notification; use Fitprime\L9SmsApi\L9SmsApiChannel; use Fitprime\L9SmsApi\L9SmsApiMessage; class TestSms extends Notification { public function via($notifiable) { return [L9SmsApiChannel::class]; } public function toL9Smsapi($notifiable) { return (new L9SmsApiMessage()) ->content( 'Text message content' ) ->to($notifiable->phone_number); } }
Available Message methods
content()
set the SMS message content
to()
set the SMS message recipient
sender()
set the SMS message sender
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please use the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.