Download the PHP package craftsys/msg91-laravel without Composer
On this page you can find all versions of the php package craftsys/msg91-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download craftsys/msg91-laravel
More information about craftsys/msg91-laravel
Files in craftsys/msg91-laravel
Package msg91-laravel
Short Description Laravel service provider for Msg91 apis to Send OTPs, Verify OTPs, Resend OTPs, Send SMS (Short Message) etc
License MIT
Homepage https://github.com/craftsys/msg91-laravel
Informations about the package msg91-laravel
Laravel service provider for Msg91
This is a laravel service provider for Msg91 APIs. It wraps the msg91-php client and provides the same functionality for Laravel applications by exposing a Service Provider and Facade.
Table of Contents
- Installation
- Configuration
- Usage
- Examples
- Managing OTPs
- Send OTP
- Verify OTP
- Resend OTP
- Sending SMS
- Bulk SMS
- Message Variables
- Handling Responses
- Managing OTPs
- Related
- Acknowledgements
Installation
The packages is available on Packagist and can be installed via Composer by executing following command in shell.
prerequisite
- php^7.1
- laravel^5|^6|^7|^8|^9|^10
The package is tested for 5.8+,^6.0,^7.0,^8.0,^9.0,^10.0 only. If you find any bugs for laravel (5.0< >5.8), please file an issue.
Laravel 5.5+
If you're using Laravel 5.5 or above, the package will automatically register the Craftsys\Msg91\Msg91LaravelServiceProvider
provider and aliases Craftsys\Msg91\Facade\Msg91
facade to Msg91
.
Laravel 5.4 and below
Add Craftsys\Msg91\Msg91LaravelServiceProvider
to the providers
array in your config/app.php
:
If you want to use the facade interface, you can use
the facade class when needed:
Or add an alias in your config/app.php
To verify that everything is working as expected, excecute the following php code somewhere in your application, either
in an example route or in php artisan tinker
if you are in Laravel.
If there is an issue, please check the steps again or open an issue for support.
Configuration
As the msg91-php offers configuration that are similar to Laravel's configuration, this package simply ports the Laravel's configuration to the msg91-php client.
The package can be configured by providing a msg91
key inside your config/services.php
configuration file.
and update the .env
file to get the desired values e.g. Msg91_KEY
.
Please visit msg91-php configuration for a detailed description about the available options and their default values.
Usage
Once you have msg91-php client (Craftsys\Msg91\Client) instance.
Follow along with examples to learn more
Examples
Managing OTPs
OTP services like sending, verifying, and resending etc, can be accessed via otp
method on the client instance e.g. Msg91::otp()
.
For a detailed usage, please visit msg91-php's documentation on managing OTPs.
Send OTP
Verify OTP
Resend OTP
Sending SMS
Bulk SMS
Message Variables
For a detailed usage and options, please visit msg91-php's documentation on sending SMSs.
Handling Responses
All the services will return \Craftsys\Msg91\Support\Response
instance for all successfully responses or will throw exceptions if request validation failed (\Craftsys\Msg91\Exceptions\ValidationException
)or there was an error in the response (\Craftsys\Msg91\Exceptions\ResponseErrorException
).
For all the examples and options, please consult msg91-php examples section
Related
Acknowledgements
We are grateful to the authors of existing related projects for their ideas and collaboration:
All versions of msg91-laravel with dependencies
craftsys/msg91-php Version ^0.15.4
illuminate/support Version ^5.2|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0