Download the PHP package voerro/laravel-email-verification without Composer

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

Laravel Email Verification

Packagist Packagist Packagist

Easily add email verification to your web project or API.

Installation

1) Install the package using composer:

2) Laravel has package auto-discovery since version 5.5. If you have an older version, register the service provider in config/app.php:

3) Run the migration to install the package's table to manage verification tokens:

4) Add the package's trait EmailVerifiable to your User model to add helper methods to it, namely the verificationToken() relationship and a method to check if the user's email has been verified emailVerified().

Further Installation - Web Project

Further steps for a regular web project. Skip this section if you're developing an API.

1) Override the registered method on the RegisterController file. Call the package's registered() method inside.

The registered() method generates a token for a newly registered user, emails it to them, logs the user out, and redirects them to the login page with a message. More on this later.

2) Register the package's middleware which logs out and redirect to the login page all authenticated users with unverified emails. You can do this in the app/Http/Kernel.php file like this.

You can also register this middleware as a route middleware to apply it to selected routes and not the whole web middleware group.

Further Installation - An API

Further steps for an API project. Skip this section if you're developing a regular web project.

1) Call this method after you've registered a user in your API.

The registeredApi() method generates a token for a newly registered user, emails it to them, and returns a JSON response.

2) Register the package's middleware which logs out all the authenticated users with unverified emails and returns a JSON response with a 409 status code. You can do this in the app/Http/Kernel.php file like this.

You can also register this middleware as a route middleware to apply it to selected routes and not the whole api middleware group.

3) The email verification link sent in the email will point to whatever domain the API is located at, even if you're using a web client on a different domain, or say a mobile client.

The package provides a GET endpoint /api/auth/email-verification/{token} in case you want to handle the verification in some different way. It tries to verify the provided in the URL token and returns a JSON response with a message and a 200 status (in case the token is correct) or 404 status (if the token does not exists or is expired).

You'd probably want to use your own mailable in this case as well. Read about how to achieve this below.

Manually Handling or Customizing the Process

If you'd like to manually handle or customize the process, take a look at the src/EmailVerification.php class. This is the main file of the package. You can use all the methods from it directly wherever you want to, each method has a DocBlock.

The registered() method that was mentioned above also comes from that class.

The registered() Method

Below is the code of the original method.

And this is the registeredApi() method under the hood in case you're developing an API:

Using Custom Mailable

Instead of calling the registered() or registeredApi() methods in your code, copy the content of a method and paste it into your code wherever you need it. Pass your mailable to the $token->sendVerificationEmail() method. Your mailable has to accept a $token variable in the constructor. Use this variable to form the verification URL inside your mailable.

Configuration and Translations

If you want to edit the configuration file or the translations, run php artisan vendor:publish and choose Voerro\Laravel\EmailVerification\EmailVerificationServiceProvider from the list.

The configuration file will be copied to config/email_verficiation.php while the translation files to the resources/lang/vendor/email-verification/ folder. By default translations to the following languages are available:

Notifications

The package attaches notifications to the session after certain events have taken place. You can access those in your controllers and views via session('status). For example, you can add this to your main layout file:

License

This is open-sourced software licensed under the MIT license.


All versions of laravel-email-verification with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version 5.4.* || 5.5.* || 5.6.*
illuminate/database Version 5.4.* || 5.5.* || 5.6.*
nesbot/carbon Version ~1.21
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 voerro/laravel-email-verification contains the following files

Loading the files please wait ....