2017 © Pedro Peláez
 

library authy-laravel

image

flatline/authy-laravel

  • Thursday, January 30, 2014
  • by Flatline
  • Repository
  • 1 Watchers
  • 3 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

AuthyLaravel

This is a really simple laravel package that wraps Authy_Api., (*1)

Installation

  1. Install the flatline/authy-laravel package, (*2)

    $ composer require "flatline/authy-laravel:dev-master"
    
  2. Update app/config/app.php to activate Authy, (*3)

    # Add `AuthyLaravelServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'Flatline\AuthyLaravel\AuthyLaravelServiceProvider',
    )
    
    # Add the `Authy` facade to the `aliases` array
    'aliases' => array(
        ...
        'Authy' => 'Flatline\AuthyLaravel\Facades\Authy',
    )
    

The facade is not required, as you can request the Authy_Api class through the container with any variation of the following:, (*4)

$authy = app('authy');

// or:

$authy = App::make('Authy_Api');

// or even:

class Foo
{
    protected $authy;

    public function __construct(\Authy_Api $authy)
    {
        $this->authy = $authy;
    }
}

In all of the cases, the calss will be automatically initialized with your corresponding API key and url (production or sandbox) before injection., (*5)

Configuration

  1. Generate a template Authy config file, (*6)

    $ php artisan config:publish flatline/authy-laravel
    
  2. Update app/config/packages/flatline/authy-laravel/config.php with your Authy API keys and turn on or off sandbox mode:, (*7)

    return [
        /*
        |--------------------------------------------------------------------------
        | Sandbox Mode
        |--------------------------------------------------------------------------
        |
        | While you're developing your application you might want to work on the
        | sandbox environment. To do so, just set this variable to "true".
        |
        */
        'sandbox' => false,
    
        /*
        |--------------------------------------------------------------------------
        | API Keys
        |--------------------------------------------------------------------------
        |
        | First, you'll need to create your application on the Authy Dashboard.
        | Once you created your Authy App, copy the API keys and paste them here.
        |
        */
        'api_key' => 'your-api-key',
        'sandbox_api_key' => 'your-sandbox-api-key',
    ];
    

The Versions

30/01 2014

dev-master

9999999-dev

  Sources   Download

The Requires