Download the PHP package liviu-hariton/smslink-laravel without Composer
On this page you can find all versions of the php package liviu-hariton/smslink-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download liviu-hariton/smslink-laravel
More information about liviu-hariton/smslink-laravel
Files in liviu-hariton/smslink-laravel
Package smslink-laravel
Short Description A Laravel package that provides convenient access to the SMSlink.ro API
License MIT
Informations about the package smslink-laravel
SMSLink Laravel package
A Laravel PHP package that provides convenient access to the SMSLink API.
Overview
Integration with SMSLink offers the ability to perform the following actions:
- send a single SMS message
- send SMS messages in bulk
- get the balance of the account
Table Of Content
- Requirements
- Installation
- Usage
- Alter the default credentials after initialization
- Send a single SMS message
- Send messages in bulk
- Check the current balance
- Get the delivery report
- Uninstallation
- License
- SMSLink official API documentation
- Disclaimer
Requirements
- PHP >= 8.3
- Laravel >= 11.0
Installation
You can install the SMSLink Laravel package via Composer. Run the following command in your terminal:
Laravel will automatically register the package.
Publish the config file of this package with this command
The following config file will be published in config/smslink.php
Edit your .env file and add the following to it:
You can get theConnection IDandConnection Password` values from your SMSLink connections manager section
Usage
When the installation is done you can easily start consuming the SMSLink's API by using the available methods. All methods will return a JSON formatted data. Just inject the dependency in your controller's methods.
Alter the default credentials after initialization
In case you want to use different credentials for a specific request or you have them stored in a database, you can set them using the setConfig() method.
Send a single SMS message
The send() method takes two parameters:
- the phone number of the recipient
- the message to be sent
- an optional array of options
- all the available options are described in the official documentation
- note that the
connection_idandpasswordparameters are already set in the config file - they are not required in the options array
The method will return a JSON formatted response with the following structure:
Send messages in bulk
`
The bulk() method takes two parameters:
- an array of packages
- each package must contain the following keys:
id- the ID of the packageto- the phone number of the recipientmessage- the message to be sent
- an optional array of options
- all the available options are described in the official documentation
- note that the
connection_idandpasswordparameters are already set in the config file - they are not required in the options array
Check the current balance
The credit() method takes no parameters and will return a JSON formatted response with the following structure:
Get the delivery report
With this method, you can parse the delivery report received from the SmsLink API via a POST or a GET request
The delivery_report() method takes no parameters and will return a JSON formatted response with the following structure:
All the available fields are described in the official documentation
Uninstallation
You can uninstall the SMSLink Laravel package via Composer. Run the following command in your terminal:
Also, make sure to remove the following files created by the package in your Laravel root directory:
/config/smslink.php
Update your .env file and remove the following lines:
License
This library is licensed under the MIT License. See the LICENSE.md file for details.
SMSLink official API documentation
- The official documentation is available on smslink.ro
Disclaimer
I am not affiliated with SMSLink, but I am a developer who sees the value of their SMS Gateway services. The development and maintenance of this library is solely my responsibility (and any contributors to this repository).
Feel free to explore this library here on GitHub, contribute, and make the most of SMSLink’s powerful SMS Gateway services!