Skip to content

Commit 2722da4

Browse files
author
Joel Butcher
committed
update README
1 parent 3807f82 commit 2722da4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# Laravel Facebook Graph SDK
22

3+
## Installation
4+
5+
Getting started with Laravel Facebook Graph is easy - first, install the package via composer
6+
7+
```
8+
composer require joelbutcher/laravel-facebook-graph
9+
```
10+
11+
Then publish the package config:
12+
13+
```
14+
php artisan vendor:publish --provider="JoelButcher\Facebook\FacebookServiceProvider"
15+
```
16+
17+
This will add a `config/facebook.php` file to your project. Here you may configure the following options:
18+
19+
| Option | Description |
20+
| ------- | ------------- |
21+
| `app_id` | Used to identify your app when requesting a users' access token |
22+
| `app_secret` | The secret key used to authorize your app with Facebook |
23+
| `redirect_url` | The destination URL to redirect users to, after authenticating with Facebook |
24+
| `graph_version` | The graph version to target when making user-authenticated requests to the Facebook Graph API, defaults to v11.0 |
25+
| `beta_mode` | Indicates whether or not to run a beta version of the SDK |
26+
27+
## URL Detection Handler
28+
You may add a custom URL Detection handler, by binding a singleton your implementation in the `register` method of the `AppServiceProvider`:
29+
30+
```php
31+
$this->app->singleton(UrlDetectionInterface::class, fn ($app) => $app[UrlDetectionHandler::class])
32+
```
33+
334
## Persistent Data Handlers
435

536
In order to store the `state` for OAuth requests to Facebook, you will either need to register a persistent data handler. You can find an example of how to do this [here](./docs/examples/persistent_data_storage.md)
37+
38+
## HTTP Client
39+
The current version of the Facebook Graph SDK (v6) uses [HTTPlug](http://httplug.io/) for making requests. If you wish to use your own HTTP Client, it MUST implment the `Http\Client\HttpClient` interface. Please refer to [this example](./docs/examples/http_client.md)

0 commit comments

Comments
 (0)