Download the PHP package gitdevstar/laravel-otp-validate without Composer

On this page you can find all versions of the php package gitdevstar/laravel-otp-validate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-otp-validate

OTP Validate Package in Laravel

This package is for easy setup for OTP validation process. No hassle, just plug and play. Following the steps mentioned below and you will be able to get a fully working OTP Validation system. You can use this later for authentication or e-commerce production selling, order confirmation.

Laravel 8|9

Latest Stable Version

Total Downloads

License

Requirements

Installation

Install Package

Require this package with composer:

Add Service Provider & Facade

For Laravel 5.5+

Once the package is added, the service provider and facade will be auto discovered.

For Older versions of Laravel

Add the ServiceProvider to the providers array in config/app.php:

Add the Facade to the aliases array in config/app.php:

Publish Config

Once done, publish the config to your config folder using:

This command will create a config/otp.php file.

Email Configs

From the .env file the email configs are setup. No other changes required.

SMS Configs

As the SMS Gateways use different methods and also extra headers and params, you may need to update the sms configs in the otp.php file.

Migrate Database

Run the following command to create the otps table.

It will create a otps table with the required columns.

Environment

Add the following Key-Value pair to the .env file in the Laravel application

Definitions

Definition of the features in config are:

Defining Send By on Runtime

The config method can be used to set send-by [ SMS / Email / SNS ] at runtime.

config('otp.send-by.email', 1);
config('otp.send-by.sms', 0);

OTP Request Templates

Once the template files are published, open resources/views/vendor/template-otp/

Sample Controller

Run the following command to create a controller.

php artisan make:controller OtpController

Below is a sample for calling the OTP Validator in OtpController.

Add the following to the routes/web.php file.

Response/Error Descriptions

The below table describes the error codes generated in the response and their corresponding meanings.

Request OTP Response Codes

Code Meanings
201 Successfully Generated OTP and shared.
400 Bad request.
501 Resend Service Disabled.
503 Service Unavailable.

OTP Validate Response Codes

Code Meanings
200 Correct OTP.
400 Invalid OTP.
404 OTP Expired/Not Found.
413 Max Retry Exceeded.

License

MIT

Special Thanks

Support

Featured Article

Example SMS Gateways Configuration

Muthofun

If you are trying to integrate one of most popular SMS gateway of Bangladesh, muthofun is a popular Bulk SMS Gateway in our country. Here is a sample configuration for the Muthofun SMS Gateway

.env file will be as the following

Infobip

Example for integrating with the infobip SMS platform, renowned SMS Gateway.

using GET method

.env file will be as the following

msg91

Sample for integrating with the msg91 SMS gateway.

using GET method

.env file will be as the following

Using AWS Simple Notification Service (SNS)

Sample steps for integrating with the AWS SNS.

Create a IAM user with the appropriate policy permissions. Go to the IAM service and create your application’s user; be sure to capture its AWS Key and AWS Secret values and put this into your environment file. From there add the following policy to the user or its group.

Here we set the ability to publish, set SMS attributes and check for opt-outs and apply this across a wildcard resource instead of a specific topic as we will be sending notifications directly to phone numbers and not an SNS topic.


All versions of laravel-otp-validate with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.8|^8.0
guzzlehttp/guzzle Version ^7.0.1
nesbot/carbon Version ^2.22
aws/aws-sdk-php Version ^3.179
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gitdevstar/laravel-otp-validate contains the following files

Loading the files please wait ....