Package Data | |
---|---|
Maintainer Username: | martinbean |
Maintainer Contact: | martin@martinbean.co.uk (Martin Bean) |
Package Create Date: | 2017-04-12 |
Package Last Update: | 2017-04-12 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:13:15 |
Package Statistics | |
---|---|
Total Downloads: | 11 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
$ composer require martinbean/laravel-facebook-data-handler
You need to specify your Facebook app ID and secret to use the SDK.
First, add the following to your .env file:
FACEBOOK_CLIENT_ID=your-client-id
FACEBOOK_CLIENT_SECRET=your-client-secret
Then, add the following section to your config/services.php file:
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
],
The Facebook SDK and persistent data handler are wrapped up in a service
provider that you can drop in to your Laravel 5 applications. Simply add the
following to the providers
array in your config/app.php file:
MartinBean\Facebook\Providers\FacebookServiceProvider::class,
Now, whenever you type-hint Facebook\Facebook
in your application, you’ll get
the Facebook SDK pre-configured with your app ID, secret, and the persistent
data handler contained in this package.
For example:
<?php
namespace App\Http\Controllers;
use Facebook\Facebook;
class FacebookLoginController extends Controller
{
protected $facebook;
public function __construct(Facebook $facebook)
{
$this->facebook = $facebook;
}
}
Licensed under the MIT License.
Please open a GitHub Issue.