PHPackages                             dees040/laravel-auth-extra - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dees040/laravel-auth-extra

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dees040/laravel-auth-extra
==========================

A Laravel package for extra authentication options.

26PHP

Since May 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dees040/laravel-auth-extra)[ Packagist](https://packagist.org/packages/dees040/laravel-auth-extra)[ RSS](/packages/dees040-laravel-auth-extra/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

AuthExtra
=========

[](#authextra)

This plugin gives you extra options for Authentication, such as:

- Track login attempts
- Verify email address
- Block suspicious login attempts
- Two factor authentication

Installation
------------

[](#installation)

Install the latest version with composer.

```
composer require dees040/laravel-auth-extra

```

After installing the packages and the service provider to the `providers` array in `app/config.php`.

```
dees040\AuthExtra\ServiceProvider::class,
```

Also add the following class to the `aliases` array. This gives you the ability to use the Facade.

```
'AuthExtra' => dees040\AuthExtra\Facade\AuthManager::class,
```

Publish configuration
---------------------

[](#publish-configuration)

First run the `vendor:publish` command so the package generate it's config file.

```
php artisan vendor:publish --provider="dees040\AuthExtra\ServiceProvider"
```

This will generate the `config/auth_extra.php` file, this file holds all the configuration for the package. More about the options in the configuration file can be found [here](https://github.com/dees040/laravel-auth-extra#configurations).

Usage
-----

[](#usage)

Your `User` model should implement the `AuthenticatableContract`. This is done automatically if the model extends the `Illuminate\Foundation\Auth\User`. Which is the [default on a fresh Laravel installation](https://github.com/laravel/laravel/blob/master/app/User.php#L8).

### Email verification

[](#email-verification)

To use email verification, set the `verify_email` config value to `true`.

When an user registers a new account we will automatically send an email to the user to verify if the signed up with a valid email address.

**Check verification**

You can add the AuthExtra trait to your `User` model. This will give you the `verifiedEmail` method. The method will return a boolean depending on the verification of the user.

```
