ibonly/laravel-accountkit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ibonly/laravel-accountkit

最新稳定版本:v1.2

Composer 安装命令:

composer require ibonly/laravel-accountkit

包简介

Two factor authentication using facebook account kit

README 文档

README

Laravel Facebook Account Kit

License

A simple package to make Password-less Login possible in Laravel using Facebook's Account Kit.

See Example Here.

Requirements

php 7.0+

Composer

Laravel 5.x

Installation

To use this package in a Laravel Project, install via Composer

$ composer require ibonly/laravel-accountkit

Register the package to the Service Provider in the config/app.php file:

'providers' => [
    ...
    Ibonly\FacebookAccountKit\FacebookAccountKitServiceProvider::class,
],

'aliases' => [
    ...
    'AccountKit' => Ibonly\FacebookAccountKit\Facades\FacebookAccountKitFacade::class,
],

You can make of some assets provided in this package to speed up your implementation: run

$ php artisan vendor:publish --provider="Ibonly\FacebookAccountKit\FacebookAccountKitServiceProvider"

Usage

Create your app on Facebook following guidelines here.

You can view example here.

Update .env file with credentials from Facebook:

ACCOUNTKIT_APP_ID=XXXXXXXXXXXX
ACCOUNTKIT_APP_SECRET=XXXXXXXXXXXXXXXXXXXXXXXX

Define your route in routes/web.php. E.g:

Route::post('/otp-login', 'LoginController@otpLogin');

Import the package in your Controller and use it therein. E.g:

use AccountKit;
use Illuminate\Http\Request;

class LoginController extends Controller
{
    ...
    public function otpLogin(Request $request)
    {
        $otpLogin = AccountKit::accountKitData($request->code);
        ...
    }
}

The above return an array similar to this:

[▼
  "id" => "1802782826673865"
  "phoneNumber" => "+234XXXXXXXXXXX",
  "email" => ""
]

Views

Update the public/js/accountkit.js file with your appId. Same as the one in your env.

Ensure you add Accounkit SDK to your HTML file:

<script type="text/javascript" src="https://sdk.accountkit.com/en_US/sdk.js"></script>

Ensure your form has csrf_token , hidden input code along with email and phone number inputs. E.g:

<input type="hidden" name="_token" id="_token" value="{{ csrf_token() }}">
<input type="hidden" name="code" id="code" />

Testing

Run any of the following commands in your terminal.

$ composer test

Credits

This package is maintained by Ibrahim Adeniyi and Surajudeen AKANDE.

Contributing

Please check out CONTRIBUTING file for detailed contribution guidelines.

Change log

Please check out CHANGELOG file for information on what has changed recently.

License

This package is released under the MIT Licence. See the bundled LICENSE file for details.

统计信息

  • 总下载量: 16.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 28
  • Watchers: 6
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固