Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Facebook Graph Sdk Laravel Package

martin1982/facebook-graph-sdk

PHP 7.4+ Facebook Graph SDK (v7) for accessing the Facebook Platform. Install via Composer, initialize with app ID/secret, and make Graph API requests with built-in helpers for login flows and access tokens. Includes docs and PHPUnit tests.

View on GitHub
Deep Wiki
Context7

Application for the Facebook SDK for PHP

In order to make requests to the Graph API, you need to create a Facebook app and obtain the app ID and the app secret. The Facebook\Application entity represents the Facebook app that is making the requests to the Graph API.

Warning: It is quite uncommon to work with the Application entity directly since the Facebook\Facebook service handles injecting it into the required classes for you.

Facebook\Application

To instantiate a new Facebook\Application entity, pass the app ID and app secret to the constructor.

$fbApp = new Facebook\Application('{app-id}', '{app-secret}');

Alternatively you can obtain the Facebook\Application entity from the Facebook\Facebook super service class.

$fb = new Facebook\Facebook([/* . . . */]);
$fbApp = $fb->getApplication();

You'll rarely be using the Application entity directly unless you're doing some extreme customizations of the SDK for PHP. But this entity plays an important role in the internal workings of the SDK for PHP.

Instance Methods

getAccessToken()

public Facebook\Authentication\AccessToken getAccessToken()

Returns an app access token in the form of an AccessToken entity.

getId()

public string getId()

Returns the app id.

getSecret()

public string getSecret()

Returns the app secret.

Serialization

The Facebook\Application entity can be serialized and unserialized.

$fbApp = new Facebook\Application('foo-app-id', 'foo-app-secret');

$serializedApplication = serialize($fbApp);
// C:29:"Facebook\\Application":54:{a:2:{i:0;s:10:"foo-app-id";i:1;s:14:"foo-app-secret";}}

$unserializedApplication = unserialize($serializedApplication);
echo $unserializedApplication->getAccessToken();
// foo-app-id|foo-app-secret
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony