This package makes it easy to send Bigmsgbox sms notifications with Laravel 8+
You can install the package via composer:
composer require owenoj/laravel-bigmsgbox
BIGMSGBOX_API_KEY=ABXCDSD
BIGMSGBOX_API_SECRET=HFHFK992
BIGMSGBOX_SENDERID=MyCompany
Now you can use the channel in your via() method inside the notification:
use Owenoj\LaravelBigmsgbox\BigmsgboxChannel;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [BigmsgboxChannel::class];
}
public function toBigmsgbox($notifiable)
{
return "Your account was approved!";//your message
}
}
You can also send sms via Facade like so:
namespace App\Http\Controllers;
use Owenoj\LaravelBigmsgbox\Bigmsgbox;
use Illuminate\Notifications\Notification;
class AccountController extends Controller
{
public function sendsms()
{
$message = "Your account was approved!";
$to = '2331234567890';
return Bigmsgbox::send($to,$message);
}
}
In order to let your Notification know which phone are you sending to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForBigmsgbox method to your Notifiable model.
public function routeNotificationForBigmsgbox()
{
return '2331234567890';
}
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email owen.j@terktrendz.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.