2017 © Pedro PelΓ‘ez
 

package laravel2step

Laravel 2 Step Authentication Package

image

jeremykenedy/laravel2step

Laravel 2 Step Authentication Package

  • Sunday, May 13, 2018
  • by jeremykenedy
  • Repository
  • 3 Watchers
  • 26 Stars
  • 5,571 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 7 Versions
  • 45 % Grown

The README.md

Laravel 2 Step Verification, (*1)

Laravel 2 Step Verification

Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects., (*2)

Travis-CI Build Latest Stable Version Total Downloads StyleCI Build Status Scrutinizer Code Quality Code Intelligence Status MadeWithLaravel.com shield License: MIT, (*3)

Table of contents: - Features - Requirements - Installation Instructions - Configuration - Environment File - Usage - Routes - Screenshots - File Tree - Future - Opening an Issue - License, (*4)

Features

Laravel 2 Step Verification Features
Uses Notification Class to send user code to users email
Can publish customizable views and assets
Lots of configuration options
Uses Language localization files
Verificaton Page
Locked Page

Requirements

Installation Instructions

  1. From your projects root folder in terminal run:, (*5)

    Laravel 6+ use:, (*6)

        composer require jeremykenedy/laravel2step
    

    Laravel 5.8 use:, (*7)

        composer require jeremykenedy/laravel2step:v1.4.0
    

    Laravel 5.7 and below use:, (*8)

        composer require jeremykenedy/laravel2step:v1.0.2
    
  2. Register the package, (*9)

  • Laravel 5.5 and up Uses package auto discovery feature, no need to edit the config/app.php file., (*10)

  • Laravel 5.4 and below Register the package with laravel in config/app.php under providers with the following:, (*11)

    'providers' => [
        jeremykenedy\laravel2step\laravel2stepServiceProvider::class,
    ];
  1. Publish the packages views, config file, assets, and language files by running the following from your projects root folder:
    php artisan vendor:publish --tag=laravel2step
  1. Optionally Update your .env file and associated settings (see Environment File section), (*12)

  2. Run the migration to add the verifications codes table:, (*13)

    php artisan migrate
  • Note: If you want to specify a different table or connection make sure you update your .env file with the needed configuration variables.
  1. Make sure your apps email is configured - this is usually done by configuring the Laravel out the box settings in the .env file.

Configuration

Laravel 2-Step Verification can be configured in directly in /config/laravel2step.php or in the variables in your .env file., (*14)

Environment File

Here are the .env file variables available:, (*15)

LARAVEL_2STEP_ENABLED=true
LARAVEL_2STEP_DATABASE_CONNECTION=mysql
LARAVEL_2STEP_DATABASE_TABLE=laravel2step
LARAVEL_2STEP_USER_MODEL=App\User
LARAVEL_2STEP_EMAIL_FROM="anEmailIsrequired@email.com"
LARAVEL_2STEP_EMAIL_FROM_NAME="Laravel 2 Step Verification"
LARAVEL_2STEP_EMAIL_SUBJECT='Laravel 2 Step Verification'
LARAVEL_2STEP_EXCEEDED_COUNT=3
LARAVEL_2STEP_EXCEEDED_COUNTDOWN_MINUTES=1440
LARAVEL_2STEP_VERIFIED_LIFETIME_MINUTES=360
LARAVEL_2STEP_RESET_BUFFER_IN_SECONDS=300
LARAVEL_2STEP_CSS_FILE="css/laravel2step/app.css"
LARAVEL_2STEP_APP_CSS_ENABLED=false
LARAVEL_2STEP_APP_CSS="css/app.css"
LARAVEL_2STEP_BOOTSTRAP_CSS_CDN_ENABLED=true
LARAVEL_2STEP_BOOTSTRAP_CSS_CDN="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"

Usage

Laravel 2-Step Verification is enabled via middleware. You can enable 2-Step Verification in your routes and controllers via the following middleware:, (*16)

twostep

Example to start recording page views using middlware in web.php:, (*17)

Route::group(['middleware' => ['twostep']], function () {
    Route::get('/home', 'HomeController@index')->name('home');
});

Routes

  • /verification/needed
  • /verification/verify
  • /verification/resend

Screenshots

Verification Page Resent Email Modal Lock Warning Modal Locked Page Verification Email, (*18)

File Tree

└── laravel2step
    β”œβ”€β”€ .gitignore
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ README.md
    β”œβ”€β”€ composer.json
    └── src
        β”œβ”€β”€ .env.example
        β”œβ”€β”€ Laravel2stepServiceProvider.php
        β”œβ”€β”€ app
        β”‚Β Β  β”œβ”€β”€ Http
        β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Controllers
        β”‚Β Β  β”‚Β Β  β”‚Β Β  └── TwoStepController.php
        β”‚Β Β  β”‚Β Β  └── Middleware
        β”‚Β Β  β”‚Β Β      └── Laravel2step.php
        β”‚Β Β  β”œβ”€β”€ Models
        β”‚Β Β  β”‚Β Β  └── TwoStepAuth.php
        β”‚Β Β  β”œβ”€β”€ Notifications
        β”‚Β Β  β”‚Β Β  └── SendVerificationCodeEmail.php
        β”‚Β Β  └── Traits
        β”‚Β Β      └── Laravel2StepTrait.php
        β”œβ”€β”€ config
        β”‚Β Β  └── laravel2step.php
        β”œβ”€β”€ database
        β”‚Β Β  └── migrations
        β”‚Β Β      └── 2017_12_09_070937_create_two_step_auth_table.php
        β”œβ”€β”€ public
        β”‚Β Β  └── css
        β”‚Β Β      β”œβ”€β”€ app.css
        β”‚Β Β      └── app.min.css
        β”œβ”€β”€ resources
        β”‚Β Β  β”œβ”€β”€ assets
        β”‚Β Β  β”‚Β Β  └── scss
        β”‚Β Β  β”‚Β Β      β”œβ”€β”€ _animations.scss
        β”‚Β Β  β”‚Β Β      β”œβ”€β”€ _mixins.scss
        β”‚Β Β  β”‚Β Β      β”œβ”€β”€ _modals.scss
        β”‚Β Β  β”‚Β Β      β”œβ”€β”€ _variables.scss
        β”‚Β Β  β”‚Β Β      β”œβ”€β”€ _verification.scss
        β”‚Β Β  β”‚Β Β      └── app.scss
        β”‚Β Β  β”œβ”€β”€ lang
        β”‚Β Β  β”‚Β Β  └── en
        β”‚Β Β  β”‚Β Β      └── laravel-verification.php
        β”‚Β Β  └── views
        β”‚Β Β      β”œβ”€β”€ layouts
        β”‚Β Β      β”‚Β Β  └── app.blade.php
        β”‚Β Β      β”œβ”€β”€ partials
        β”‚Β Β      β”œβ”€β”€ scripts
        β”‚Β Β      β”‚Β Β  └── input-parsing-auto-stepper.blade.php
        β”‚Β Β      └── twostep
        β”‚Β Β          β”œβ”€β”€ exceeded.blade.php
        β”‚Β Β          └── verification.blade.php
        └── routes
            └── web.php

  • Tree command can be installed using brew: brew install tree
  • File tree generated using command tree -a -I '.git|node_modules|vendor|storage|tests

Future

  • Unit Tests
  • Travis-CI Integration.
  • Its own HTML email template.
  • Add in additional notifications for SMS or ???.
  • Add in capture IP Address.
  • Change to incremental tables and logic accordingly
    • Create Artisan command and job to prune said entries.

Opening an Issue

Before opening an issue there are a couple of considerations: * You are all awesome! * Read the instructions and make sure all steps were followed correctly. * Check that the issue is not specific to your development environment setup. * Provide duplication steps. * Attempt to look into the issue, and if you have a solution, make a pull request. * Show that you have made an attempt to look into the issue. * Check to see if the issue you are reporting is a duplicate of a previous reported issue. * Following these instructions show me that you have tried. * If you have a questions send me an email to jeremykenedy@gmail.com * Need some help, I can do my best on Slack: https://opensourcehelpgroup.slack.com * Please be considerate that this is an open source project that I provide to the community for FREE when openeing an issue., (*19)

Open source projects are a the community’s responsibility to use, contribute, and debug., (*20)

License

Laravel 2-Step Verification is licensed under the MIT license. Enjoy!, (*21)

The Versions

13/05 2018

dev-master

9999999-dev

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

13/05 2018

dev-analysis-qvYVmr

dev-analysis-qvYVmr

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

22/01 2018

v1.0.2

1.0.2.0

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

22/01 2018

v1.0.1

1.0.1.0

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

20/01 2018

v1.0.0

1.0.0.0

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

20/01 2018

v0.5.0

0.5.0.0

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel verification 2-step verification

19/01 2018

v0.0.1

0.0.1.0

Laravel 2 Step Authentication Package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Avatar jeremykenedy

laravel monitor