PHPackages                             alexwinder/laravel-confirm-new-email - 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. alexwinder/laravel-confirm-new-email

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

alexwinder/laravel-confirm-new-email
====================================

A Laravel 5 package which makes a user verify their email address when updated.

v0.0.2(6y ago)04MITPHPPHP &gt;=7.1.3

Since Jul 7Pushed 2y agoCompare

[ Source](https://github.com/AlexWinder/laravel-confirm-new-email)[ Packagist](https://packagist.org/packages/alexwinder/laravel-confirm-new-email)[ RSS](/packages/alexwinder-laravel-confirm-new-email/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (5)Versions (3)Used By (0)

Verify Updated User E-Mail Address in Laravel 5
===============================================

[](#verify-updated-user-e-mail-address-in-laravel-5)

This is a package for [Laravel](https://laravel.com/) which provides functionality that when a user wants to update their e-mail address they must first verify their new e-mail address for it to be successfully updated. This is particularly useful if you want to ensure that a user has control of an e-mail address when they want to make this change to their account.

This is done by sending an e-mail notification to the new users e-mail address, when they click on the link inside that e-mail then their e-mail address will be updated on the system. Upon a successful update of a users e-mail address a second e-mail notification is then sent to the new and the old e-mail address notifying the user of the change to their account.

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

[](#installation)

### Require Into Composer

[](#require-into-composer)

Require this package into your `composer.json`.

```
composer require alexwinder/laravel-confirm-new-email
```

### Register Service Provider

[](#register-service-provider)

Register the [ConfirmNewEmailServiceProvider](src/ConfirmNewEmailServiceProvider.php) in the providers of your Laravel application under `config/app.php` in the `providers` array.

```
'providers' => [
    ...
    AlexWinder\ConfirmNewEmail\ConfirmNewEmailServiceProvider::class,
    ...
],
```

### Confirm User Model

[](#confirm-user-model)

In your `config/auth.php` ensure that you have correctly specified your User model and table in the `providers` array.

```
'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => Namespace\Of\Your\User\Model\User::class,
        'table' => 'users'
    ],
],
```

### E-Mail Attribute Mass-Assignment

[](#e-mail-attribute-mass-assignment)

You must ensure that your User model has the attribute which relates to e-mail address added to its `$fillable` array if you are protecting against mass-assignment in your Laravel project, by default all Eloquent models protect against mass-assignment. If you do not add this value to the `$fillable` array you will receive a mass-assignment exception. For example:

```
