Please register to your account credentials at iSMS Official Website. The API is using Basic Authentication(so username and password will do).
via composer:
composer require medkad/laravel-isms
php artisan vendor:publish --provider="Medkad\ISMS\ISMSServiceProvider"
Add your ISMS Account credentials to your config/isms.php
:
// config/isms.php
...
'username' => env('ISMS_USERNAME', 'medkad'),
'password' => env('ISMS_PASSWORD', 'password'),
'url' => env('ISMS_URL', 'https://www.isms.com.my/RESTAPI.php'),
...
// .env
...
ISMS_USERNAME=
ISMS_PASSWORD=
ISMS_URL='https://www.isms.com.my/RESTAPI.php'
...
In order to let your Notification know which phone are you sending to, the channel will look for the mobile_number
attribute of the Notifiable model (eg. User model). If you want to override this behaviour, add the routeNotificationForISMS
method to your Notifiable model.
public function routeNotificationForISMS()
{
return $this->phone_number;
}
Now you can use the channel in your via()
method inside the notification:
use Medkad\ISMS\ISMS;
use Medkad\ISMS\ISMSChannel;
use Illuminate\Notifications\Notification;
class OrderNotification extends Notification
{
public function via($notifiable)
{
return [ISMSChannel::class];
}
public function toISMS($notifiable)
{
return new ISMS('Your SMS Here!');
}
}
The MIT License (MIT). Please see License File for more information.