PHP Classes

Laravel Account Kit: Authenticate users with Facebook accounts

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 80 All time: 10,113 This week: 455Up
Version License PHP version Categories
laravel-accountkit 1.0.2BSD License5PHP 5, User Management, Web services, S...
Description 

Authors

Ibraheem Adeniyi
Surajudeen Akande


Contributor

This package allows to authenticate users with Facebook accounts.

It can be used to setup a login controller that will handler that will get the Facebook user account token to access Facebook API to get the user account details.

A Facebook application needs to be created to allow the user account details access.

Picture of adeniyi ibraheem
  Performance   Level  
Name: adeniyi ibraheem <contact>
Classes: 6 packages by
Country: Nigeria Nigeria
Age: 37
All time rank: 18819 in Nigeria Nigeria
Week rank: 159 Up4 in Nigeria Nigeria Up

Documentation

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

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.


  Files folder image Files (14)  
File Role Description
Files folder imageresources (1 directory)
Files folder imagesrc (3 files, 1 directory)
Files folder imagetest (1 file)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file Readme.md Doc. Documentation

  Files folder image Files (14)  /  resources  
File Role Description
Files folder imageconfig (2 files)

  Files folder image Files (14)  /  resources  /  config  
File Role Description
  Accessible without login Plain text file accountkit.js Data Auxiliary data
  Accessible without login Plain text file accountKit.php Aux. Auxiliary script

  Files folder image Files (14)  /  src  
File Role Description
Files folder imageFacades (1 file)
  Plain text file AccountKit.php Class Class source
  Plain text file FacebookAccountKit.php Class Class source
  Plain text file FacebookAccountKitServiceProvider.php Class Class source

  Files folder image Files (14)  /  src  /  Facades  
File Role Description
  Plain text file FacebookAccountKitFacade.php Class Class source

  Files folder image Files (14)  /  test  
File Role Description
  Plain text file AccountKitTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:80
This week:0
All time:10,113
This week:455Up