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'));
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>
If you needs to change the default setting for your app you must publish the configuration file.
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);
}
}
content()
set the SMS message content
to()
set the SMS message recipient
sender()
set the SMS message sender
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please use the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.