https://github.com/laravel-notification-channels/infobip
Infobip notifications channel for Laravel.
https://github.com/laravel-notification-channels/infobip
hacktoberfest infobip laravel notifications sms
Last synced: 7 days ago
JSON representation
Infobip notifications channel for Laravel.
- Host: GitHub
- URL: https://github.com/laravel-notification-channels/infobip
- Owner: laravel-notification-channels
- License: mit
- Created: 2020-08-06T23:32:58.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-28T21:44:30.000Z (over 4 years ago)
- Last Synced: 2025-06-12T01:07:41.478Z (10 days ago)
- Topics: hacktoberfest, infobip, laravel, notifications, sms
- Language: PHP
- Homepage: http://laravel-notification-channels.com/
- Size: 25.4 KB
- Stars: 5
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Notifications Channel for Infobip
[](https://packagist.org/packages/laravel-notification-channels/infobip)
[](LICENSE.md)
[](https://travis-ci.org/laravel-notification-channels/infobip)
[](https://styleci.io/repos/285692286)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/infobip)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/infobip/?branch=master)
[](https://packagist.org/packages/laravel-notification-channels/infobip)This package makes it easy to send notifications using [Infobip](https://www.infobip.com/) with Laravel 5.5+, 6.x and 7.x
## Contents
- [Installation](#installation)
- [Setting up the Infobip service](#setting-up-your-infobip-account)
- [Usage](#usage)
- [On-Demand Notifications](#on-demand-notifications)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)## Installation
You can install the package via composer:
``` bash
composer require laravel-notification-channels/infobip
```## Setting up your Infobip account
Add your Infobip Product Token and default originator (name or number of sender) to your `config/services.php`:
```php
// config/services.php
...
'infobip' => [
'username' => env('INFOBIP_USERNAME'),
'password' => env('INFOBIP_PASSWORD'),
'from' => env('INFOBIP_FROM', 'Info'),
'notify_url' = env('INFOBIP_NOTIFY_URL', null),
],
...
```To change `Base URL` to personal use this ([See more](https://dev.infobip.com/getting-started/base-url))
```php
...
'infobip' => [
...
'baseUrl' => env('INFOBIP_BASE_URL', null),
],
...
```## Usage
You can use the channel in your via() method inside the notification:
```php
use Illuminate\Notifications\Notification;
use NotificationChannels\Infobip\InfobipMessage;class AccountApproved extends Notification
{
public function via($notifiable)
{
return ["infobip"];
}public function toInfobip($notifiable)
{
return (new InfobipMessage)->content("Your account was approved!");
}
}
```In your notifiable model, make sure to include a routeNotificationForInfobip() method, which returns a phone number or an array of phone numbers.
```php
public function routeNotificationForInfobip()
{
return $this->phone_number;
}
```### On-Demand Notifications
Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:```php
Notification::route('infobip', '5555555555')
->notify(new InvoicePaid($invoice));
```### Available Message methods
`from('')`: Accepts a phone number/sender name to use as the notification sender.. *Make sure to register the sender name at you Infobip dashboard.*`content('')`: Accepts a string value for the notification body.
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Thomson Maguru](https://github.com/tomsgad)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.