Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joelbutcher/laravel-facebook-graph
Laravel wrapper for the Facebook Graph PHP 8 SDK
https://github.com/joelbutcher/laravel-facebook-graph
Last synced: 5 days ago
JSON representation
Laravel wrapper for the Facebook Graph PHP 8 SDK
- Host: GitHub
- URL: https://github.com/joelbutcher/laravel-facebook-graph
- Owner: joelbutcher
- Created: 2021-07-31T10:53:08.000Z (over 3 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-04-09T08:33:45.000Z (10 months ago)
- Last Synced: 2025-01-14T13:11:33.167Z (12 days ago)
- Language: PHP
- Size: 39.1 KB
- Stars: 70
- Watchers: 8
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- laravel-awesome - Laravel Facebook Graph SDK - Facebook API bridge (Popular Packages)
README
# Laravel Facebook Graph SDK
## Installation
Getting started with Laravel Facebook Graph is easy - first, install the package via composer
```
composer require joelbutcher/laravel-facebook-graph
```Then publish the package config:
```
php artisan vendor:publish --provider="JoelButcher\Facebook\FacebookServiceProvider"
```This will add a `config/facebook.php` file to your project. Here you may configure the following options:
| Option | Description |
| ------- | ------------- |
| `app_id` | Used to identify your app when requesting a users' access token |
| `app_secret` | The secret key used to authorize your app with Facebook |
| `redirect_url` | The destination URL to redirect users to, after authenticating with Facebook |
| `graph_version` | The graph version to target when making user-authenticated requests to the Facebook Graph API, defaults to v11.0 |
| `beta_mode` | Indicates whether or not to run a beta version of the SDK |## URL Detection Handler
You may add a custom URL Detection handler, by binding a singleton your implementation in the `register` method of the `AppServiceProvider`:```php
$this->app->singleton(UrlDetectionInterface::class, fn ($app) => $app[UrlDetectionHandler::class])
```## Persistent Data Handlers
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)
## HTTP Client
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)