Download the PHP package variablesign/sms without Composer
On this page you can find all versions of the php package variablesign/sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download variablesign/sms
More information about variablesign/sms
Files in variablesign/sms
Package sms
Short Description A Laravel SMS Gateway Integration package for bulk SMS providers in Ghana
License MIT
Homepage https://github.com/variablesign/sms
Informations about the package sms
Laravel SMS Sender
A Laravel SMS Gateway Integration package for bulk SMS providers in Ghana. Below are the gateways that are currently supported and others added in future updates.
Available features:
- Check remaining SMS balance or credits
- Send SMS messages
- Check SMS delivery status
- Send OTP messages
Supported gateways:
- SMS Online GH
- USMS-GH
- mNotify
- Arkesel
- More in future updates
System Requirements
- PHP 7.2 or greater
- Laravel 7 or greater
Installation
You can install the package via composer:
Configuration
Publish the sms config by running this command after installation:
Head to config/sms.php
to start editing the configuration settings. Change the default gateway by setting the value to any of the gateways defined in the list of gateways. You can however ever switch between gateways in your code which will ignore the default config value.
The following shows the options for smsonlinegh
gateway.
Usage
Checking SMS balance
You can check your SMS balance or credits by using any of the following.
Without facades
With helper function
Returns an integer as the response or null
as the default;
Sending SMS messages
You can send SMS messages by using any of the following.
Without facades
With helper function
Returns \Illuminate\Support\Collection
as the response;
Checking SMS delivery status
You can check the delivery status of submitted messages by using their message id
.
Without facades
With helper function
Returns \Illuminate\Support\Collection
as the response;
Sending OTP messages
You can use our otp()
method to generate and quickly send one-time-pin messages.
Returns \Illuminate\Support\Collection
as the response;
Without expiration time
Returns \Illuminate\Support\Collection
as the response;
Or with your own custom messages. Use the :code
placeholder in your messages and it will be replaced with the generated OTP. You can generate a code length between 4
to 8
. The example below generates a code length of 6
.
Returns \Illuminate\Support\Collection
as the response;
Channel Usage
You can also send SMS messages through Laravel's notification class using php artisan make:notification
command via sms
or SmsChannel::class
as the channel. If you want to change the sms
channel name or disable it from being registered, you can do so in the config file.
Sending the notification:
Notification channel response
You can learn how to retrieve the response through the NotificationSent
event from the Notification section of the Laravel docs.
Debugging
You can die dump the raw api response by adding the dd()
method.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Variable Sign
- All Contributors
License
The MIT License (MIT). Please see License File for more information.