LaravelPackages.net
Acme Inc.
Toggle sidebar
masif088/flexcodesdk

:description

25
0
About masif088/flexcodesdk

masif088/flexcodesdk is a Laravel package for :description. It currently has 0 GitHub stars and 25 downloads on Packagist. Install it with composer require masif088/flexcodesdk. Discover more Laravel packages by masif088 or browse all Laravel packages to compare alternatives.

Last updated

flexcodesdk

Latest Version on Packagist Total Downloads Build Status StyleCI

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require masif088/flexcodesdk:dev-master

Usage

Publish Vendor

$ php artisan vendor:publish

Choose 'flexcodesdk-config' and 'flexcodesdk-models'

Migrate Database

$ php artisan:migrate

Blade

{{ flexcodesdk::getRegistrationLink($user_id) }}

Edit app/Providers/EventServiceProvider.php

Event::listen('fingerprints.register', function($data)
{
    // Do some stuff before informing URL to user

    // inform SDK to open this URL
    echo url('test?message=' . $data['message']);
});


Event::listen('fingerprints.verify', function($data){
    $action = $data['extras']['action'];
    switch ($action) {
        case 'login':
            // Log user to database here, i.e: Adding new session etc.
            // Example: 
            // Session::add($data['user']->id);

            // Then tell SDK to open this page
            echo action('testController@index', array('message' => $data['message']));
            break;
        
        case 'transactions.confirm':
            // mark transaction as verified, example usage:

            // $transaction = Transaction::find($data['extras']['transaction_id']);
            // $transaction->verified = true;
            // $transaction->save();

            // Then tell SDK to open this page
            echo route('transactions', 
                array(
                    'message' => $data['message'], 
                    'id' => $data['extras']['transaction_id'])
                );
            break;
    }
});

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

Comments