PHPackages                             samkitano/laravel-user-activation - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. samkitano/laravel-user-activation

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

samkitano/laravel-user-activation
=================================

User Activation by confirmation email for Laravel 5.2

v1.0.0(9y ago)21932MITPHPPHP &gt;=5.6.0

Since Jul 15Pushed 9y ago2 watchersCompare

[ Source](https://github.com/samkitano/laravel-user-activation)[ Packagist](https://packagist.org/packages/samkitano/laravel-user-activation)[ RSS](/packages/samkitano-laravel-user-activation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

User activation for Laravel 5.2
===============================

[](#user-activation-for-laravel-52)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f3493b115437e4ef341a96a8bc78dcd094e407a81423b8168431644e57e19fb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d6b6974616e6f2f6c61726176656c2d757365722d61637469766174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samkitano/laravel-user-activation)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/f5377061334dc4da59db25a834b0a41c4b5fdd6405da03a2c077ec84fae92e94/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616d6b6974616e6f2f6c61726176656c2d757365722d61637469766174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/samkitano/laravel-user-activation)

This package implements a simple user verification by email by means of a random token, aka "Activation Code".

Description
-----------

[](#description)

The purpose of this package is to take advantage of Laravel's native Registration and Authentication features, by simply running `php artisan make:auth` and avoid the hassle of writing any aditional routes, controllers and/or views.

Once installed and configured, it will observe the :created event on the user provider model. As soon as a User is created, it will trigger the service provider that will handle the activation process: token creation, sending an activation email, and storage.

The newly registered user will be unable to login, unless a request is made with the proper unique token (activation link).

We will then check if the request is "legit", and, if required by the configuration settings, it's lifetime.

Uniqueness of token is ensured by a random sha256 hash (64 char long).

The user will have the ability to request a new token, in the login form, as long as valid credentials (those used upon registration) are provided; Just in case the user lost his token, for whatever reason. He who never accidentally deleted an email...

The site admin also has an option to receive email notifications of such events: user registered, user activated, and user requested a new token.

All email outputs are queued, for improved performance.

Requirements
------------

[](#requirements)

```
-Laravel >= 5.2.X
-PHP >= 5.6

```

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

[](#installation)

After creating your Authentication routes and views with `php artisan make:auth` proceed with installation:

1 - Require with Composer: `composer require samkitano/laravel-user-activation`

2 - Include the service provider in the 'providers' array within `config/app.php`.

```
'providers' => [
    Kitano\UserActivation\UserActivationServiceProvider::class,
];
```

3 - Publish the package. MUST use the *--force* option in order to replace default views. Those will be the exact same thing, with just a small session check added.

```
    php artisan vendor:publish --force
```

4 - Run migrations:

```
    php artisan migrate
```

5 - Import and Replace Traits in `app\Http\Controllers\Auth\AuthController.php`

```
