2017 © Pedro Peláez
 

library laravel-double-opt-in

Double-opt-in registration for Laravel 5.1.

image

m3rten/laravel-double-opt-in

Double-opt-in registration for Laravel 5.1.

  • Wednesday, October 14, 2015
  • by m3rten
  • Repository
  • 1 Watchers
  • 2 Stars
  • 195 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 21 % Grown

The README.md

Double-opt-in registration for Laravel 5.1

This package provides double-opt-in registration with user activation to Laravel 5.1., (*1)

Features:, (*2)

  • Newly registered users are marked "inactive" and can't login into the application
  • An email with a verification link is sent to the user after registration
  • A form for requesting a new activation email (in case the first activation email was lost)

Prerequisites

The package extends the functionality of the trait Illuminate\Foundation\Auth\AuthenticatesUsers, so if you are using a custom Authentication Controller this package might not work for you. Also the package asumes the User model and user table are used for authentication (may be decoupled in later versions), (*3)

Usage

Install the package via composer:, (*4)

    composer require "m3rten/laravel-double-opt-in"

Add the Service Provider to config/app.php, (*5)

    'providers' => [
        /* ... */
        M3rten\DoubleOptIn\DoubleOptInServiceProvider::class,
    ],

Replace the used traits in app/Http/Controllers/Auth/AuthController.php with:, (*6)

    use AuthenticatesUsers, RegisterAndActivateUsers, ThrottlesLogins {
        RegisterAndActivateUsers::getCredentials insteadof AuthenticatesUsers;
    }

Publish the packages assets and run the migration., (*7)

    php artisan vendor:publish
    php artisan migrate

If you'd like to alter the provided blade templates you may edit the files in /resources/views/vendor/doubleoptin. If you'd like to alter the provided language files you may edit the files in /resources/lang/vendor/doubleoptin., (*8)

Add the activation an verification routes to your app/Http/routes.php, (*9)

    Route::get('/verify/{token}', ['as' => 'activation.verify','uses' => 'Auth\AuthController@verify',]);
    Route::get('/activate', ['as' => 'activation.edit','uses' => 'Auth\AuthController@editActivation',]);
    Route::post('/activate', ['as' => 'activation.update','uses' => 'Auth\AuthController@postActivation',]);

Error and success messages are output via Laravels flash messaging using the variables "message" and "message-type". You may include the message output in your login and registration forms:, (*10)

    @include('doubleoptin::partials.message')    

The Versions

14/10 2015

dev-master

9999999-dev

Double-opt-in registration for Laravel 5.1.

  Sources   Download

MIT

by Sebastian Merten

14/10 2015

v0.1.1

0.1.1.0

Double-opt-in registration for Laravel 5.1.

  Sources   Download

MIT

by Sebastian Merten

14/10 2015

v0.1.0

0.1.0.0

Double-opt-in registration for Laravel 5.1.

  Sources   Download

MIT

by Sebastian Merten