2017 © Pedro Peláez
 

library laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

image

tayokin/laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

  • Sunday, April 8, 2018
  • by tayokin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Laravel Facebook Account Kit

License, (*1)

A simple package to make Password-less Login possible in Laravel using Facebook's Account Kit., (*2)

Requirements

php 7.1+, (*3)

Composer, (*4)

Laravel 5.x, (*5)

Installation

To use this package in a Laravel Project, install via Composer, (*6)

$ composer require tayokin/laravel-facebook-accountkit

Register the package to the Service Provider in the config/app.php file:, (*7)

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

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

You can make of some assets provided in this package to speed up your implementation: run, (*8)

$ php artisan vendor:publish

Usage

Create your app on Facebook following guidelines here., (*9)

You can view example here., (*10)

Update .env file with credentials from Facebook:, (*11)

ACCOUNTKIT_APP_ID=XXXXXXXXXXXX
ACCOUNTKIT_APP_SECRET=XXXXXXXXXXXXXXXXXXXXXXXX
ACCOUNTKIT_REDIRECT_URL=<path/to/endpoint>

Define your route in routes/web.php. E.g:, (*12)

Route::get('/<path/to/endpoint>', 'FacebookAccountKitController@endpoint');

Import the package in your Controller and use it therein. E.g:, (*13)

use Tayokin\FacebookAccountKit\Facades\FacebookAccountKitFacade;
use Illuminate\Http\Request;

class FacebookAccountKitController extends Controller
{
    ...
    public function endpoint(Request $request)
    {
        $accountData = FacebookAccountKitFacade::getAccountDataByCode($request->get('code'));
        ...
    }
}

The above return an array similar to this:, (*14)

[▼
  "id" => "1802782826673865"
  "phoneNumber" => "+38093XXXXXXX",
  "email" => ""
]

Views

Ensure your form has csrf_token, E.g:, (*15)

<input type="hidden" name="state" value="{{ csrf_token() }}" />

You can also specify country. E.g:, (*16)

<input type="hidden" name="country_code" value="UA">

Testing

bash $ vendor/bin/phpunit test, (*17)

Credits

This package is maintained by Tayokin Max., (*18)

Change log

Please check out CHANGELOG file for information on what has changed recently., (*19)

License

This package is released under the MIT Licence. See the bundled LICENSE file for details., (*20)

The Versions

08/04 2018

dev-master

9999999-dev https://github.com/tayokin/laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php facebook accountkit account kit

08/04 2018

v1.0.3

1.0.3.0 https://github.com/tayokin/laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php facebook accountkit account kit

08/04 2018

v1.0.2

1.0.2.0 https://github.com/tayokin/laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php facebook accountkit account kit

08/04 2018

v1.0.1

1.0.1.0 https://github.com/tayokin/laravel-facebook-accountkit

Laravel Facebook Account Kit SDK (PHP)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php facebook accountkit account kit