Download the PHP package agiledrop/laravel-telnyx without Composer
On this page you can find all versions of the php package agiledrop/laravel-telnyx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download agiledrop/laravel-telnyx
More information about agiledrop/laravel-telnyx
Files in agiledrop/laravel-telnyx
Package laravel-telnyx
Short Description Telnyx SMS service Notification Channel for Laravel.
License MIT
Homepage https://github.com/agiledrop/laravel-telnyx
Informations about the package laravel-telnyx
Laravel Telnyx Driver
This package enables to send SMS and MMS notifications from your Laravel application.
Requires Laravel 7+
Prerequisites
You first need to register a Telnyx account, generate a phone number a messaging profile, and an API key.
Notice that at the moment just American phone numbers are allowed to send SMS, so you will need to generate an American number.
Installation
You can install the package via composer:
You should publish and run the migrations with:
You should publish the config file with:
This is the contents of the published config file:
You should then add you your .env file the following variables with your parameters:
Usage
In your Laravel Notification you just need to
- Specify the notification channel
- import the class and implement the toTelnyx() method.
Sending an SMS notification
This is an example of SMS notification.
Create a notification
Generate a notification with an artisan command:
This will create for you the file at
Then paste in that the following code:
Then to use this notification, just import it in where you need it and run it like below:
Override the RouteNotificationFor in your user model
This metod is used to determine where to route the notification to.
Sending an MMS notification (available just for US)
This is an example of MMS notification.
Create a notification with an artisan command:
This will create:
Then paste in that the following code:
Then to use this notification, just import it where you need and run it like below:
Testing
To test you need to create a .env
file with the Telnyx credentials.
eg.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Davide Casiraghi
- Jernej Beg
- All Contributors
License
The MIT License (MIT). Please see License File for more information.