xinax / laravel-latch
Laravel wrapper for Latch SDK (Second security layer).
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/xinax/laravel-latch
Requires
- php: >=5.3.0
- laravel/framework: 4.*
Requires (Dev)
- mockery/mockery: dev-master
This package is not auto-updated.
Last update: 2025-10-07 12:15:12 UTC
README
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);