Download the PHP package cuongnx/laravel-flexible-otp without Composer

On this page you can find all versions of the php package cuongnx/laravel-flexible-otp. 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-flexible-otp

cuongnx/laravel-flexible-otp

Latest Version on Packagist Total Downloads License

A powerful and highly flexible One-Time Password (OTP) package for Laravel applications.


✨ Key Features


📦 Requirements


🚀 Installation

The package auto-registers its service provider and facade.


⚙️ Configuration

Publish the configuration file (recommended):

This will create:


🧩 Create the OTP Model

The package supports both MySQL and MongoDB.

Generate the appropriate model:

After generation, update the config:


🗄 Migration

A migration is included and automatically published. Run:

This creates the one_time_passwords table or collection.


🛠 Usage


🧾 Example Configuration (config/otp.php)


📩 Automatic OTP Sending

When send: true is passed, the package dispatches an OtpGenerated event.

Create a listener to handle sending:

Then implement your sending logic inside the handle method.

Quick Start: Generate Ready-to-Use Listener

The package provides a convenient command to create a complete listener with pre-built support for popular providers:

This command generates app/Listeners/SendOtpListener.php with ready-to-use code for:

You can also specify a custom name:


🧹 Cleaning Expired OTPs

Manually clean expired OTPs:

Recommended: schedule it in app/Console/Kernel.php:


📄 License

MIT License – see the LICENSE file for details.


cuongnx/laravel-flexible-otp – A flexible, secure, and developer-friendly OTP solution for modern Laravel projects.


All versions of laravel-flexible-otp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0
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 cuongnx/laravel-flexible-otp contains the following files

Loading the files please wait ...