Download the PHP package ccmelas/laravel-sharenet without Composer
On this page you can find all versions of the php package ccmelas/laravel-sharenet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ccmelas/laravel-sharenet
More information about ccmelas/laravel-sharenet
Files in ccmelas/laravel-sharenet
Package laravel-sharenet
Short Description A Laravel Package for Sharenet
License MIT
Informations about the package laravel-sharenet
laravel-sharenet
A Laravel Package for sending SMS using Sharenet (Nigeria only)
Installation
In the composer.json folder in the root of your laravel installation, add the following in the require block
Then run:
If your project is using Laravel 5.5 upwards, you can skip the next two instructions in this section and jump straight to Configuration.
In the providers array of config/app.php
, add the following line:
In the aliases array of the same file, add the following:
Configuration
Add your Sharenet key to your .env file like so:
To get a Sharenet Key, visit app.sharenet.io, login or create an account if you don't have one already. On the top-right, click on your avatar and then your profile. In the developer tab, create a new Personal Access Token
. A modal will come up with your Secret Key.
You wouldn't need to but if you wish to publish the sharenet.php config file, run the following
Usage
Here's a simple snippet showing how you can use this package
You can chain a getResponse()
method to get a response in the form
You can directly check if your message was sent successfully like so:
Sharenet::send($data)->isSuccessful()
You can also use Sharenet as a custom driver for your Laravel Notifications like so:
This package expects your $notifiable
entity to have a phone
property. You can specify an alternative property by overriding the routeNotificationForSharenet
method of your notifiable entity.
By default, your notification will use the SHARENET_SENDER_NAME
value defined in the config file as the sender name. If you wish to override this, you can return an array in the notifications toSharenet
method like so:
Contributing
This package is open for contributions. Feel free to fork it and make enhancements.
License
The MIT License (MIT). Please see License File for more information.
Wanna talk?
You can always shoot me an email @ [email protected]
Love the package? Leave a star.
Don't forget to follow me on twitter!