https://github.com/baspa/bandwidth-laravel-notification-channel
https://github.com/baspa/bandwidth-laravel-notification-channel
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/baspa/bandwidth-laravel-notification-channel
- Owner: Baspa
- License: mit
- Created: 2024-09-05T18:57:02.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-09-05T19:15:28.000Z (9 months ago)
- Last Synced: 2025-03-19T20:51:51.591Z (2 months ago)
- Language: PHP
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bandwidth Notifications Channel for Laravel
[](https://packagist.org/packages/laravel-notification-channels/bandwidth)
[](LICENSE.md)
[](https://travis-ci.org/laravel-notification-channels/bandwidth)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/bandwidth)
[](https://packagist.org/packages/laravel-notification-channels/bandwidth)This package makes it easy to send notifications using [Bandwidth](https://www.bandwidth.com) with Laravel 10.x.
## Contents
- [Installation](#installation)
- [Setting up the Bandwidth service](#setting-up-the-bandwidth-service)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)## Installation
You can install this package via composer:
```bash
composer require laravel-notification-channels/bandwidth
```### Setting up the Bandwidth service
To use the Bandwidth service, you need to create an account and obtain the necessary credentials. Follow these steps:
1. Sign up for a Bandwidth account at [https://www.bandwidth.com](https://www.bandwidth.com).
2. Navigate to your Bandwidth dashboard and locate your Account ID, API Username, and API Password.
3. Add the following configuration to your `config/services.php` file:```php
'bandwidth' => [
'username' => env('BANDWIDTH_USERNAME'),
'password' => env('BANDWIDTH_PASSWORD'),
// 'applicationId' => env('BANDWIDTH_APPLICATION_ID'),
],
```## Usage
```php
use Illuminate\Notifications\Notification;class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [BandwidthChannel::class];
}public function toBandwidth($notifiable): array
{
return (new BandwidthMessage())
->from('+12345678901')
->to($notifiable->phone_number)
->text('Your invoice has been paid!')
->applicationId('your-application-id');
}
}
```In your notifiable model, make sure to include the `routeNotificationForBandwidth` method:
```php
class User extends Authenticatable implements Notifiable
{
use HasFactory, Notifiable;public function routeNotificationForBandwidth($notification)
{
return $this->phone_number;
}
}
```### Available Message methods
- `from` - The phone number the message should be sent from.
- `to` - The phone number the message should be sent to.
- `text` - The message content.
- `applicationId` - The application ID.## 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 author email instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Bas van Dinther](https://github.com/basvandinther)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.