Download the PHP package nextapps/laravel-verification-code without Composer

On this page you can find all versions of the php package nextapps/laravel-verification-code. 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-verification-code

Laravel Verification Code

Latest Version on Packagist Total Downloads

This package makes it possible to authenticate a user via a verification code.

Installation

You can install this package using composer:

The package will automatically register itself.

You can publish the migration with:

After publishing the migration, run the migration with:

You can publish the config file with:

Usage

Generate and send a verification code

This will generate a verification code for the user. The code will be stored in the verification_codes table. An email with the generated code will then be sent to the user matching the given email address.

Verify a verification code

If the verification code is expired or does not match the user's email address, it will return false. If valid, it will return true and delete the code.

If you do not want the code to be deleted (in case the same code needs to be verified at different points in the login flow) you can pass a third parameter.

Verification codes table cleanup

Since it is possible for the verification codes table to fill up with unused codes, the following command will prune all codes older than the given hours.

Config settings

Length

This value defines the length of every generated verification code.

Characters

You can define which characters are used to generate a verification code. By default, certain characters are excluded (0, O, I, L) because they look too similar.

Expire seconds

A verification code is only valid for a certain amount of time. You can define after how many seconds a verification code will expire.

Max codes per verifiable

By default, only one verification code can be active per verifiable. If you want to allow multiple active codes per verifiable, then you can change this setting to a different number (or to null if you want unlimited codes per verifiable).

Custom Notification

If you want to use a custom notification to send the verification code, you can create your own notification class which should extend the VerificationCodeCreatedInterface. Make sure you don't forget to pass the verification code to the mail.

Custom Model

If you want to use a custom verification code model, you can create your own verification code class which should extend the VerificationCode.

Queue

If your notification is queueable, you can define the queue that will be used for the notification.

Test verifiables and test code

You sometimes may want to allow a user to log in immediately without letting them go through the verification code flow. To do this you can add the verifiable (e.g. email address) to the test_verifiables array. You then need to define a test_code. The combination of the verifiable and the test code will make it possible for the user to pass through.

Testing

You can run tests with:

Linting

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-verification-code with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/database Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/notifications Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.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 nextapps/laravel-verification-code contains the following files

Loading the files please wait ....