Download the PHP package rasulian/laravel-user-verification without Composer

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

laravel-user-verification

A simple package to activate the users by token and code number.

This package allows you to verify the users either by token to be sent by email and code number for SMS.

Installation

This package can be used in Laravel 5.4 or higher.

You can install the package via composer:

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

You may add the following aliases to your config/app.php:

Publish the package config and database migration file by running the following command:

Configuration

Migration

The table representing the user model must be updated with the verified column. This update will be performed by the migration included with this package.

Please make sure that you don't have the this column on your user table.

If your user table name is not users, you may change that in the config/verification.php.

Now you can migrate the normal way you do:

Middleware

This package provides an optional middleware throwing UserVerifiedMiddleware. Please refer to the Laravel Documentation to learn more about how to work with the exception handler.

To register the default middleware add the following lines to the $routeMiddleware array within the app/Http/Kernel.php file:

You may use this middleware for the routes that needs the user's email or phone number be verified:

Errors

This package throws several exception. you may use try\catch statement or the Laravel exception handler.

Usage

Route

By default this package provide one route to verify the user by token.

Overriding package route

To define your own custom routes, put the package service provider call before the RouteServiceProvider call in the config/app.php file.

Then, add your custom route in your route file.

Facade

The package offers a facade Verification::.

verification Config file

After publishing the package config, it will be located at the config directory. You are free to change the table name for the user and the user_verifications which represents the fields for storing the token and code.

How to use the package

This package is written as simple as possible. It creates a token and code for the user and verifies the user either by token or code.

Here is a sample on how to generate a token, send it as an email and verify it.

Edit the App\Http\Auth\RegisterController file:

Here we use the registered method to create token and send it, which will overrides \Illuminate\Foundation\Auth\RegistersUsers@registered method. We get a token for the given user, make it as a url and send it as an email.

If the user clicks on the link, the verifyUser method will be executed. Here we just verify the user by the given token.

Please make sure that you add the verifyUser to the except array of the guest middleware in the constructor.

Relaunch the process

If you want to regenerate and resend the verification token, you can do this with the getVerificationToken method.

The generate method will generate a new token for the given user and change the verified column to false.

CONTRIBUTE

Feel free to comment, contribute and help. 1 PR = 1 feature.

LICENSE

Laravel User Verification is licensed under The MIT License (MIT).


All versions of laravel-user-verification with dependencies

PHP Build Version
Package Version
No informations.
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 rasulian/laravel-user-verification contains the following files

Loading the files please wait ....