Looking to hire Laravel developers? Try LaraJobs
This package is not available.

laravel-latch maintained by xinax

Description
Laravel wrapper for Latch SDK (Second security layer).
Last update
2014/07/01 14:35 (dev-master)
License
Downloads
14

Comments
comments powered by Disqus

Laravel Latch

Laravel package for Latch SDK.

More info about Latch: https://latch.elevenpaths.com/ Official Latch php SDK: https://github.com/ElevenPaths/latch-sdk-php

Install

This package requires Laravel 4.1.*+

  • Add repository to composer.json:
    "xinax/laravel-latch": "dev-master"
  • Update composer:
    composer update
  • Register the service provider in app.php
    'Xinax\LaravelLatch\LaravelLatchServiceProvider',

Configuration

  • Publish configuration file:
    php artisan config:publish xinax/laravel-latch
  • Set application ID and secret in:
    app/config/packages/xinax/laravel-latch/config.php

Usage

All original method names were kept. Refer to original readme for updated documentation.

Pair register

    $accountID = LaravelLatch::pair($pairCode);

Latch status check

    try{
        LaravelLatch::status($accountID);
    } catch (Xinax\LaravelLatch\Exceptions\ClosedLatchException $e){
        // ... latch protection logic ...
    } catch (Xinax\LaravelLatch\Exceptions\LatchErrorException $e){ 
        // ... crisis logic (depends of your security policy) ...
    }

Unpair

    LaravelLatch::unpair($accountID);