This package makes it easy to send notifications using MadarSMS with Laravel.
This package can be installed via composer:
composer require laravel-notification-channels/madar-sms
- Create an account in Madar SMS here
- Create configuration file
config/madar.php
, You can also publish the config file with the command:
php artisan vendor:publish --provider="NotificationChannels\Madar\MadarServiceProvider"
You can use this channel by adding MadarChannel::class
to the array in the via()
method of your notification class. You need to add the toMadarSms()
method which should return a new MadarMessage()
object.
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use NotificationChannels\Madar\MadarChannel;
use NotificationChannels\Madar\MadarMessage;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [MadarChannel::class];
}
public function toMadarSms() {
return (new MadarMessage('I\'m using Madar SMS!'))
->sender('My Company');
}
}
getPayloadValue($key)
: Returns payload value for a given key.content(string $message)
: Sets SMS message text.numbers(string $number)
: Set recipients number(s).sender(string $from)
: Set senders name.delay(string $timestamp)
: Delays message to given timestamp.repeat($repeat = '0')
: Allow the repeating of sms sending with same data.by()
: The type of the API.
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.