SMS Notification Driver for sms.forss.net
forss/laravel-forss-sms-notifications is a Laravel package for sms notification driver for sms.forss.net.
It currently has 0 GitHub stars and 34 downloads on Packagist (latest version 1.0.1).
Install it with composer require forss/laravel-forss-sms-notifications.
Discover more Laravel packages by forss
or browse all Laravel packages to compare alternatives.
Last updated
Extend config/services.php to read your Forss SMS API credentials from your .env:
return [
...
'forss_sms' => [
'username' => env('FORSS_SMS_USERNAME'),
'password' => env('FORSS_SMS_PASSWORD'),
'sender' => env('FORSS_SMS_SENDER'),
]
];
Add your Forss SMS API credentials to your .env:
FORSS_SMS_USERNAME=username
FORSS_SMS_PASSWORD=password
FORSS_SMS_SENDER=sender
Add a toForssSms method to your Notification class:
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Forss\Laravel\Notifications\ForssSms\ForssSmsMessage;
use Forss\Laravel\Notifications\ForssSms\ForssSmsChannel;
class TestSms extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return [ForssSmsChannel::class];
}
public function toForssSms() {
return ForssSmsMessage::create('Hello World');
}
}
Add a routeNotificationForForssSms method to your Notifiable class:
class User extends Authenticatable
{
use Notifiable;
public function routeNotificationForForssSms()
{
//Return whatever phone number to use for the SMS
return $this->phone;
}
}