THIS PROJECT IS NO LONGER BEING MAINTAINED
This package makes it easy to send notifications using SMSDev with Laravel.
This package can be installed via composer:
composer require lucasgiovanny/laravel-notification-smsdev
- Add the API key to the
services.phpconfig file:
// config/services.php
...
'smsdev' => [
'api_key' => env('SMSDEV_API_KEY')
],
...- Add you API Key from SMSDev to your
.envfile
- First you need to add the function
routeNotificationForin theUsermodel:
public function routeNotificationFor()
{
return $this->phone_number; //replace with the phone number field you have in your model
}- Now, you can use this channel by adding
SmsDevChannel::classto the array in thevia()method of your notification class. You need to add thetoSmsdev()method which should return anew SmsDevMessage()object.
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use lucasgiovanny\SmsDev\SmsDevChannel;
use lucasgiovanny\SmsDev\SmsDevMessage;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [SmsDevChannel::class];
}
public function toSmsdev() {
return (new SmsDevMessage('Invoice paid!'));
}
}-
getPayloadValue($key): Returns payload value for a given key. -
content(string $message): Sets SMS message text. -
to(string $number): Set manually the recipients number (international format).
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.