Facebook Query Builder: A query builder for nested requests in the Facebook Graph API

Overview

Facebook Query Builder

Build Status Latest Stable Version Total Downloads License

A query builder that makes it easy to create complex & efficient nested requests to Facebook's Graph API to get lots of specific data back with one request.

Facebook Query Builder has no production dependencies.

$fqb = new SammyK\FacebookQueryBuilder\FQB;

$photosEdge = $fqb->edge('photos')->fields(['id', 'source'])->limit(5);
$request = $fqb->node('me')->fields(['id', 'email', $photosEdge]);

echo (string) $request;
# https://graph.facebook.com/me?fields=id,email,photos.limit(5){id,source}

Introduction

The Facebook Query Builder uses the same Graph API nomenclature for three main concepts:

  1. Node: A node represents a "real-world thing" on Facebook like a user or a page.
  2. Edge: An edge is the relationship between two or more nodes. For example a "photo" node would have a "comments" edge.
  3. Field: Nodes have properties associated with them. These properties are called fields. A user has an "id" and "name" field for example.

When you send a request to the Graph API, the URL is structured like so:

https://graph.facebook.com/node-id/edge-name?fields=field-name

To generate the same URL with Facebook Query Builder, you'd do the following:

$edge = $fqb->edge('edge-name')->fields('field-name');
echo $fqb->node('node-id')->fields($edge);

If you were to execute that script, you might be surprised to see the URL looks a little different because it would output:

https://graph.facebook.com/node-id?fields=edge-name{field-name}

The two URL's are functionally identical with the exception of how the Graph API returns the response data. What makes the URL generated with Facebook Query Builder different is that it is being expressed as a nested request.

And that is what makes Facebook Query Builder so powerful. It does the heavy lifting to generate properly formatted nested requests from a fluent, easy-to-read PHP interface.

Installation

Facebook Query Builder is installed using Composer. Add the Facebook Query Builder package to your composer.json file.

{
    "require": {
        "sammyk/facebook-query-builder": "^2.0"
    }
}

Usage

Initialization

To start interfacing with Facebook Query Builder you simply instantiate a FQB object.

// Assuming you've included your composer autoload.php file before this line.
$fqb = new SammyK\FacebookQueryBuilder\FQB;

There are a number of configuration options you can pass to the FQB constructor.

A basic example

Below is a basic example that gets the logged in user's id & email (assuming the user granted your app the email permission).

$fqb = new SammyK\FacebookQueryBuilder\FQB;

$request = $fqb->node('me')
               ->fields(['id', 'email'])
               ->accessToken('user-access-token')
               ->graphVersion('v3.1');

echo $request;
# https://graph.facebook.com/v3.1/me?access_token=user-access-token&fields=id,email

$response = file_get_contents((string) $request);

var_dump($response);
# string(50) "{"id":"12345678","email":"foo-bar\u0040gmail.com"}"

Get data across multiple edges

The bread and butter of the Facebook Query Builder is its support for nested requests. Nested requests allow you to get a lot of data from the Graph API with just one request.

The following example will get the logged in user's name & first 5 photos they are tagged in with just one call to Graph.

$fqb = new SammyK\FacebookQueryBuilder\FQB([/* . . . */]);

$photosEdge = $fqb->edge('photos')->fields(['id', 'source'])->limit(5);
$request = $fqb->node('me')->fields(['name', $photosEdge]);

echo $request;
# https://graph.facebook.com/me?fields=name,photos.limit(5){id,source}

// Assumes you've set a default access token
$response = file_get_contents((string) $request);

var_dump($response);
# string(1699) "{"name":"Sammy Kaye Powers","photos":{"data":[{"id":"123","source":"https:\/\/scontent.xx.fbcdn.net\/hphotos-xfp1 . . .

And edges can have other edges embedded in them to allow for infinite deepness. This allows you to do fairly complex calls to Graph while maintaining very readable code.

The following example will get user 1234's name, and first 10 photos they are tagged in. For each photo it gets the first 2 comments and all the likes.

$fqb = new SammyK\FacebookQueryBuilder\FQB([/* . . . */]);

$likesEdge = $fqb->edge('likes');
$commentsEdge = $fqb->edge('comments')->fields('message')->limit(2);
$photosEdge = $fqb->edge('photos')
                  ->fields(['id', 'source', $commentsEdge, $likesEdge])
                  ->limit(10);

$request = $fqb->node('1234')->fields(['name', $photosEdge]);

echo $request;
# https://graph.facebook.com/1234?fields=name,photos.limit(10){id,source,comments.limit(2){message},likes}

// Assumes you've set a default access token
$response = file_get_contents((string) $request);

var_dump($response);
# string(10780) "{"name":"Some Foo User","photos":{"data":[ . . .

Sending the nested request

Since Facebook Query Builder is just a tool that generates nested request syntax, it doesn't make any requests to the Graph API for you. You'll have to use some sort of HTTP client to send the requests.

We'll assume you've already created an app in Facebook and have obtained an access token.

Requests with The Facebook PHP SDK

The recommended way to send requests & receive responses is to use the official Facebook PHP SDK v5. You'll need to create an instance of the Facebook\Facebook super service class from the native Facebook PHP SDK.

$fb = new Facebook\Facebook([
    'app_id' => 'your-app-id',
    'app_secret' => 'your-app-secret',
    'default_graph_version' => 'v3.1',
    ]);
$fqb = new SammyK\FacebookQueryBuilder\FQB;

$fb->setDefaultAccessToken('my-access-token');

$request = $fqb->node('me')->fields(['id', 'name', 'email']);

echo $request->asEndpoint();
# /me?fields=id,name,email

try {
    $response = $fb->get($request->asEndpoint());
} catch (Facebook\Exceptions\FacebookSDKException $e) {
    echo $e->getMessage();
    exit;
}

var_dump($response->getDecodedBody());

You'll noticed we're using the asEndpoint() method to send the generated request to the SDK. That's because the SDK will automatically prefix the URL with the Graph API hostname. The asEndpoint() method will return an un-prefixed version of the URL.

The official Facebook PHP SDK will automatically add the Graph API version, the app secret proof, and the access token to the URL for you, so you don't have to worry about setting those options on the FQB object.

Requests with native PHP

As you've already seen in the basic examples above, you can simply use PHP's flexible file_get_contents() to send the requests to the Graph API. Just be sure to set your Graph API version prefix with default_graph_version & set your app secret with app_secret to ensure all the requests get signed with an app secret proof.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'default_graph_version' => 'v3.1',
    'app_secret'            => 'your-app-secret',
]);

// Grab Mark Zuckerberg's public info
$request = $fqb->node('4')->accessToken('my-access-token');

echo $request;
# https://graph.facebook.com/v3.1/4?access_token=my-access-token&appsecret_proof=2ad43b865030f51531ac36bb00ce4f59d9f879ecce31b0977dbfd73fa4eca7b6

$response = file_get_contents((string) $request);

var_dump($response);

For more info about handling the response, check out responses with native PHP below.

Obtaining an access token

As the Facebook Query Builder is exclusive to building nested request syntax, it cannot be used directly to obtain an access token.

The Facebook login process uses OAuth 2.0 behind the scenes. So you can use any OAuth 2.0 client library to obtain a user access token from Facebook. Here are a few recommendations:

Configuration settings

A number of configuration settings can be set via the FQB constructor.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'default_access_token'  => 'your-access-token',
    'default_graph_version' => 'v3.1',
    'app_secret'            => 'your-app-secret',
]);

Setting the access token

If you're using the Facebook PHP SDK and have set a default access token for the SDK to use, then you won't need to worry about appending the access token to the request.

If you're using some other HTTP client, you can set the default fallback access token when you instantiate the FQB service with the default_access_token option or you can append the access token to the nested request using the accessToken() method.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'default_access_token' => 'fallback_access_token',
]);

$request = $fqb->node('me');
echo $request->asEndpoint();
# /me?access_token=fallback_access_token

$request = $fqb->node('me')->accessToken('bar_token');
echo $request->asEndpoint();
# /me?access_token=bar_token

Setting the Graph version

It's important that you set the version of the Graph API that you want to use since the Graph API is subject to a breaking change schedule.

If you're using the Facebook PHP SDK and have set a default Graph version for the SDK to use, then you won't need to worry about setting the Graph version in the Facebook Query Builder.

If you're using some other HTTP client, you can set the default fallback Graph version when you instantiate the FQB service with the default_graph_version option or you can set it on a per-request basis using the graphVersion() method.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'default_graph_version' => 'v3.1',
]);

$request = $fqb->node('me');
echo $request->asEndpoint();
# /v3.1/me

$request = $fqb->node('me')->graphVersion('v1.0');
echo $request->asEndpoint();
# /v1.0/me

PS: Graph v1.0 is dead. 💀

Enabling app secret proof

As an added security feature, you can sign each request to the Graph API with an app_secretproof. It is highly recommended that you edit your app settings to require the app secret proof for all requests.

If you're using the Facebook PHP SDK to send requests to the Graph API, it will automatically append the app secret proof for you.

If you're using some other HTTP client, the app secret proof will be generated for a request if both an access token and app secret are set for a request. You can set the app secret when you instantiate the FQB service using the app_secret option.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'app_secret' => 'foo_secret',
]);

$request = $fqb->node('me')->accessToken('bar_token');
echo $request->asEndpoint();
# /me?access_token=bar_token&appsecret_proof=2ceec40b7b9fd7d38fff1767b766bcc6b1f9feb378febac4612c156e6a8354bd

Enabling the beta version of Graph

Before changes to the Graph API are rolled out to production, they are deployed to the beta tier first.

By default, when you generate a nested request, it will be prefixed with the production hostname for the Graph API which is https://graph.facebook.com/.

echo (string) $fqb->node('4');
# https://graph.facebook.com/4

To enable the beta tier for the requests generated by FQB, set the enable_beta_mode option to true. Once enabled, all generated URL's will be prefixed with the beta hostname of the Graph API which is https://graph.beta.facebook.com/.

$fqb = new SammyK\FacebookQueryBuilder\FQB([
    'enable_beta_mode' => true,
]);

echo (string) $fqb->node('4');
# https://graph.beta.facebook.com/4

Method reference

node()

node(string $graphNodeName): FQB

Returns a new mutable instance of the FQB entity. Any valid Graph node or endpoint on the Graph API can be passed to node().

$userNode = $fqb->node('me');

edge()

node(string $edgeName): GraphEdge

Returns an mutable instance of GraphEdge entity to be passed to the FQB::fields() method.

$photosEdge = $fqb->edge('photos');

fields()

fields(mixed $fieldNameOrEdge[, mixed $fieldNameOrEdge[, ...]]): FQB

Set the fields and edges for a GraphNode or GraphEdge entity. The fields and edges can be passed as an array or list of arguments.

$edge = $fqb->edge('some_edge')->fields(['field_one', 'field_two']);
$node = $fqb->node('some_node')->fields('my_field', 'my_other_field', $edge);

modifiers()

modifiers(array $modifiers): FQB

Some endpoints of the Graph API support additional parameters called "modifiers".

An example endpoint that supports modifiers is the /{object-id}/comments edge.

// Order the comments in chronological order
$commentsEdge = $fqb->edge('comments')->modifiers(['filter' => 'stream']);
$request = $fqb->node('1044180305609983')->fields('name', $commentsEdge);

limit()

limit(int $numberOfResultsToReturn): FQB

You can specify the number of results the Graph API should return from an edge with the limit() method.

$edge = $fqb->edge('photos')->limit(7);

Since the "limit" functionality is just a modifier in the Graph API, the limit() method is a convenience method for sending the limit param to the modifiers() method. So the same functionality could be expressed as:

$edge = $fqb->edge('photos')->modifiers(['limit' => 7]);

accessToken()

accessToken(string $accessToken): FQB

You can set the access token for a specific request with the accessToken() method.

$request = $fqb->node('BradfordWhelanPhotography')->accessToken('foo-token');

echo $request->asEndpoint();
# /BradfordWhelanPhotography?access_token=foo-token

graphVersion()

graphVersion(string $graphApiVersion): FQB

You can set the Graph version URL prefix for a specific request with the graphVersion() method.

$request = $fqb->node('me')->graphVersion('v3.1');

echo $request->asEndpoint();
# /v3.1/me

asUrl()

asUrl(): string

You can obtain the generated request as a full URL using the asUrl() method.

$request = $fqb->node('me');

echo $request->asUrl();
# https://graph.facebook.com/me

The magic method __toString() is a alias to the asUrl() method so casting the FQB instance as a string will perform the same action.

$request = $fqb->node('me');

echo (string) $request;
# https://graph.facebook.com/me

asEndpoint()

asEndpoint(): string

The asEndpoint() is identical to the asUrl() method except that it will return the URL without the Graph API hostname prefixed to it.

$request = $fqb->node('me');

echo $request->asEndpoint();
# /me

This is particularly handy for working with the official Facebook PHP SDK which will automatically prefix the Graph hostname to the URL for you.

Handling the response

Responses will vary depending on what HTTP client you're using to interface with the Graph API.

Responses with the Facebook PHP SDK

All responses from the get(), post(), and delete() methods return a Facebook\FacebookResponse from the native Facebook PHP SDK.

$fb = new Facebook\Facebook([/* . . . */]);
$fqb = new SammyK\FacebookQueryBuilder\FQB([/* . . . */]);

$fb->setDefaultAccessToken('my-access-token');

$request = $fqb->node('me')->fields(['email', 'photos']);

echo $request->asEndpoint();
# /me?fields=email,photos

try {
    $response = $fb->get($request->asEndpoint());
} catch (Facebook\Exceptions\FacebookSDKException $e) {
    echo $e->getMessage();
    exit;
}

$userNode = $response->getGraphUser();

// Access properties like an array
$email = $userNode['email'];

// Get data as array
$userNodeAsArray = $userNode->asArray();

// Get data as JSON string
$userNodeAsJson = $userNode->asJson();

// Iterate over the /photos edge
foreach ($userNode['photos'] as $photo) {
    // . . .
}

// Morph the data with a closure
$userNode['photos']->each(function ($value) {
    $value->new_height = $value->height + 22;
});

See the official documentation for more information on the FacebookResponse entity.

Responses with native PHP

If you're using file_get_contents() to send requests to the Graph API, the responses will be a string of JSON from the Graph API. You can decode the JSON responses to a plain-old PHP array.

string(1) "4" ["name"]=> string(15) "Mark Zuckerberg" }">
$fqb = new SammyK\FacebookQueryBuilder\FQB([/* . . . */]);

$request = $fqb->node('4')
               ->fields(['id', 'name'])
               ->accessToken('user-access-token');

echo $request;
# https://graph.facebook.com/4?access_token=user-access-token&fields=id,name

$response = file_get_contents((string) $request);

$data = json_decode($response, true);

var_dump($data);
# array(2) { ["id"]=> string(1) "4" ["name"]=> string(15) "Mark Zuckerberg" }

If there was an error response from the Graph API, file_get_contents() will return false and raise a warning. This can be problematic since the Graph API returns error details in the body of the response.

To get the error response data we need to tell file_get_contents() to return the response body even when the response contains an error HTTP status code. We can do this by setting ignore_errors to true with the stream_context_create() function.

You can also investigate the error response further by examining the response headers. The headers are stored in the $http_response_header variable which gets set automatically by file_get_contents().

array(4) { ["message"]=> string(27) "Invalid OAuth access token." ["type"]=> string(14) "OAuthException" ["code"]=> int(190) ["fbtrace_id"]=> string(11) "A8oB9BtqtZ4" } } */ var_dump($http_response_header); /* array(14) { [0]=> string(24) "HTTP/1.1 400 Bad Request" [1]=> string(89) "WWW-Authenticate: OAuth "Facebook Platform" "invalid_token" "Invalid OAuth access token."" [2]=> string(30) "Access-Control-Allow-Origin: *" [3]=> string(44) "Content-Type: text/javascript; charset=UTF-8" [4]=> string(26) "X-FB-Trace-ID: h8oB7BtrtZ3" [5]=> string(17) "X-FB-Rev: 4971439" [6]=> string(16) "Pragma: no-cache" [7]=> string(23) "Cache-Control: no-store" [8]=> string(38) "Expires: Sat, 01 Jan 2000 00:00:00 GMT" [9]=> string(21) "Vary: Accept-Encoding" [10]=> string(100) "X-FB-Debug: FOOE54KJadh9P2HOSUlSFQmNEEf/9CF4ZtgZQ==" [11]=> string(35) "Date: Fri, 09 Oct 2015 04:43:44 GMT" [12]=> string(17) "Connection: close" [13]=> string(19) "Content-Length: 113" } */">
$fqb = new SammyK\FacebookQueryBuilder\FQB([/* . . . */]);

$request = $fqb->node('Some-Invalid-Node')->accessToken('user-access-token');

echo $request;
# https://graph.facebook.com/Some-Invalid-Node?access_token=user-access-token

$context = stream_context_create(['http' => ['ignore_errors' => true]]);
$response = file_get_contents((string) $request, null, $context);

$data = json_decode($response, true);
var_dump($data);
/*
array(1) {
  ["error"]=>
  array(4) {
    ["message"]=>
    string(27) "Invalid OAuth access token."
    ["type"]=>
    string(14) "OAuthException"
    ["code"]=>
    int(190)
    ["fbtrace_id"]=>
    string(11) "A8oB9BtqtZ4"
  }
}
*/

var_dump($http_response_header);
/*
array(14) {
  [0]=>
  string(24) "HTTP/1.1 400 Bad Request"
  [1]=>
  string(89) "WWW-Authenticate: OAuth "Facebook Platform" "invalid_token" "Invalid OAuth access token.""
  [2]=>
  string(30) "Access-Control-Allow-Origin: *"
  [3]=>
  string(44) "Content-Type: text/javascript; charset=UTF-8"
  [4]=>
  string(26) "X-FB-Trace-ID: h8oB7BtrtZ3"
  [5]=>
  string(17) "X-FB-Rev: 4971439"
  [6]=>
  string(16) "Pragma: no-cache"
  [7]=>
  string(23) "Cache-Control: no-store"
  [8]=>
  string(38) "Expires: Sat, 01 Jan 2000 00:00:00 GMT"
  [9]=>
  string(21) "Vary: Accept-Encoding"
  [10]=>
  string(100) "X-FB-Debug: FOOE54KJadh9P2HOSUlSFQmNEEf/9CF4ZtgZQ=="
  [11]=>
  string(35) "Date: Fri, 09 Oct 2015 04:43:44 GMT"
  [12]=>
  string(17) "Connection: close"
  [13]=>
  string(19) "Content-Length: 113"
}
*/

Testing

Just run phpunit from the root directory of this project.

$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

CHANGELOG

Please see CHANGELOG for history.

Credits

License

The MIT License (MIT). Please see License File for more information.## License

Security

If you find a security exploit in this library, please notify the project maintainer privately to get the issue resolved.

Comments
  • Example on how to obtain a Page Access Token

    Example on how to obtain a Page Access Token

    Hello SammyK,

    Firstly thanks for all this great work that you are putting into this.

    Is it possible to show an example on how to obtain a page access token ?

    What i was able to do is :

    1. Request user access token with manage_page permissions
    2. Extend token to long lived one

    Now i know that i have to use that token with a GET on 'me/accounts' but i just cant find out how...

    Thanks!

    opened by pns2050 5
  • uploaded photos

    uploaded photos

    i can bring the uploaded photos, is this ok?

    Facebook::extend('getUserPhotosUpload', function($facebook) {

    $uploaded = $facebook->edge('uploaded')->fields('id')->limit(5);
    return $facebook->object('me/photos')->fields($uploaded)->get();
    

    });

    opened by mcpDeveloper 5
  • Fixe for access_token expiration problem.

    Fixe for access_token expiration problem.

    fixes #17

    Fix issue with extend() and default value of expires_at

    Changed setExpiresAtFromTimeStamp() because facebook is sending seconds to expire in response rather than TimeStamp

    and Facebook introduced never expiring tokens and 1 year age would be enough for those tokens.

    opened by jdsingh 3
  • isLongLived

    isLongLived

    Hi i was checking the isLongLived function and realize that from the start return false, so it always extend the token.

    i check the expires_at and it issets at 1970

    opened by mcpDeveloper 3
  • Possible to retrieve metadata?

    Possible to retrieve metadata?

    The graph API supports a request variable, metadata which brings back extra information about the object.

    /me?fields=id,email&metadata=1
    

    Is there a way to retrieve this info using this library?

    In my case I'm specifically looking for the type of the object, and as far as I can tell this is the only way to do so.

    opened by darrynten 3
  • [Question] Pagination

    [Question] Pagination

    Hi How can I make request for next page of results? I need to get all user's likes and I'm getting only 25 without setting limit and with setting limit I can get max 100 on one request. Thanks for your help.

    opened by freezy-sk 3
  • Timezone is accidentally overridden

    Timezone is accidentally overridden

    Hey,

    The following line overrides my timezone even though it has already been set with date_default_timezone_set

    https://github.com/SammyK/FacebookQueryBuilder/blob/master/src/FQB.php#L7

    Mathias

    opened by MiniCodeMonkey 3
  • Trying to use it with facebook php sdk by the following error is coming up on composer

    Trying to use it with facebook php sdk by the following error is coming up on composer

    Think it has to be last stable and not dev-master. I've already included facebook sdk on my composer.json.

      Problem 1
        - sammyk/facebook-query-builder 1.0.1 requires facebook/php-sdk-v4 dev-master -> no matching package found.
        - sammyk/facebook-query-builder 1.0.0 requires facebook/php-sdk-v4 dev-master -> no matching package found.
        - Installation request for sammyk/facebook-query-builder 1.0.* -> satisfiable by sammyk/facebook-query-builder[1.0.0, 1.0.1].
    
    Potential causes:
     - A typo in the package name
     - The package is not available in a stable-enough version according to your minimum-stability setting
       see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
    
    Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
    
    opened by sebathi 3
  • [Feature request] Support for multi-id-lookup

    [Feature request] Support for multi-id-lookup

    A request to support multi-id-lookup.

    Currently I have to use this work around to make multi-id-lookup requests.

    $get = '/?ids={id-one},{id-two}&fields=id,name';
    $object = Facebook::object($get)->get();
    

    It would be great if you can make it this way...

    $get = '/?ids={id-one},{id-two}';
    $object = Facebook::object($get)->fields('id', 'name')->get();
    

    or may be this way...

    $object = Facebook::object('?ids')->ids->({id-one},{id-two})->fields('id', 'name')->get();
    
    enhancement 
    opened by jdsingh 2
  • getGraphList() method

    getGraphList() method

    I was trying to use your pagination example without offset, but I get this error: Call to undefined method SammyK\FacebookQueryBuilder\GraphCollection::getGraphList() in /var/www/html/script/request.php on line 209 I actually checked in the GraphCollection Class and I couldn't find that method. Any idea how to solve this? This is my FQB request:

    $links = $fqb->object('me/links') ->fields('id','comments','likes') ->with(['offset' => $offset, 'since'=>1409529600]) ->limit($limit) ->get();

    Cheers

    opened by G-Giorgianni 1
  • Debug switch?

    Debug switch?

    Is there any debug switch, to see full answer from Graph API?

    $fb = App::make('facebook-query-builder'); $fb->setAccessToken('CAAIt8ie86xwBALP1tdkYTSctlj9dBc...'); $user = $fb->search('Bill', 'user')->get();

    I don't know whats wrong, because all requests returns same error "Graph returned an error response."

    opened by vojtasvoboda 1
  • Maintenance for base library usage

    Maintenance for base library usage

    Just a quick touch of maintenance for:

    1. Travis: the trusty distribution is now required to install PHP <= 5.5, see https://travis-ci.community/t/php-5-4-and-5-5-archives-missing/3723
    2. PHPUnit: from PHP 7.2 the usage of PHPUnit v4 will give warnings, PHPUnit v5 is still compatible with current tests and won't give messages
    3. exclude tests from production autoload, those shouldn't be available at all
    4. bump for current graph version

    I hope you will appreciate ✌️

    opened by EmanueleMinotto 1
  • "expires_at" bug?

    I am just starting out with the Facebook API, so I am definitely just in the learning phase. I did find what seems to be a bug:

    AccessToken.php > extend()

    $expires_at = isset($data['expires_at']) ? $data['expires_at'] : 0; should be $expires_at = isset($data['expires']) ? $data['expires'] : 0;

    If you look at $data that "expires" is the actual name of the key.

    But even after I changed this it is still not converting the date correctly for the $token. It is showing the expires_at date as public 'date' => string '1970-03-01 23:09:46.000000'

    bug 
    opened by natenrb9 6
Owner
Sammy Kaye Powers
Telemetry all the things
Sammy Kaye Powers
a tool to get Facebook data, and some Facebook bots, and extra tools found on Facebook Toolkit ++.

FACEBOOK TOOLKIT a tool to get Facebook data, and some Facebook bots, and extra tools found on Facebook Toolkit ++. Graph API Facebook. Made with ❤️ b

Wahyu Arif Purnomo 569 Dec 27, 2022
Facebook SDK for PHP (v6) - allows you to access the Facebook Platform from your PHP app

Facebook SDK for PHP (v6) This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app. Installa

null 0 Aug 10, 2022
Transporter is a futuristic way to send API requests in PHP

Transporter Transporter is a futuristic way to send API requests in PHP. This is an OOP approach to handle API requests.

Steve McDougall 369 Dec 22, 2022
Phalcon PHP REST API Package, still in beta, please submit issues or pull requests

PhREST API A Phalcon REST API package, based on Apigees guidelines as found in http://apigee.com/about/content/web-api-design Please see the skeleton

PhREST 29 Dec 27, 2022
A simple PHP project to make API requests on your cPanel installation

A simple PHP project to make API requests on your cPanel installation. This allows you to call modules inside the installation and interact with them to add, show or list data such as domains, e-mail accounts, databases and so on.

Elias Häußler 0 Sep 15, 2022
An SDK built to facilitate application development for Facebook Ads API.

Facebook Business SDK for PHP Introduction The Facebook Business SDK is a one-stop shop to help our partners better serve their businesses. Partners a

Meta 719 Dec 28, 2022
CORS (Cross-Origin Resource Sharing) for your Symfony/Laravel requests

CORS for PHP (using the Symfony HttpFoundation) Library and middleware enabling cross-origin resource sharing for your http-{foundation,kernel} using

Fruitcake 91 Dec 22, 2022
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder

PoP PoP is a monorepo containing several projects. The GraphQL API for WordPress plugin GraphQL API for WordPress is a forward-looking and powerful Gr

Leonardo Losoviz 265 Jan 7, 2023
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder

PoP PoP is a monorepo containing several projects. The GraphQL API for WordPress plugin GraphQL API for WordPress is a forward-looking and powerful Gr

Leonardo Losoviz 265 Jan 7, 2023
Syntax to query GraphQL through URL params, which grants a GraphQL API the capability to be cached on the server.

Field Query Syntax to query GraphQL through URL params, which grants a GraphQL API the capability to be cached on the server. Install Via Composer com

PoP 4 Jan 7, 2022
Laravel wrapper for Facebook's GraphQL

Laravel GraphQL Use Facebook's GraphQL with Laravel 6.0+. It is based on the PHP port of GraphQL reference implementation. You can find more informati

Mikk Mihkel Nurges 1.9k Dec 31, 2022
Fully unit tested Facebook SDK v5 integration for Laravel & Lumen

Laravel Facebook SDK A fully unit-tested package for easily integrating the Facebook SDK v5 into Laravel and Lumen 5.0, 5.1, 5.2, & 5.3. This is packa

Sammy Kaye Powers 697 Nov 6, 2022
application/hal builder / formatter for PHP 5.4+

Nocarrier\Hal This is a library for creating documents in the application/hal+json and application/hal+xml hypermedia formats It requires PHP 5.4 or l

Ben Longden 204 Sep 28, 2022
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Dec 14, 2022
Add Price Including tax for Magento's "cart" GraphQl query

Comwrap_GraphQlCartPrices Add Price Including tax for Magento's "cart" GraphQl query Query will looks like following: items { id __typenam

Comwrap 1 Dec 2, 2021
Mediator - CQRS Symfony bundle. Auto Command/Query routing to corresponding handlers.

Installation $ composer require whsv26/mediator Bundle configuration // config/packages/mediator.php return static function (MediatorConfig $config)

Alexander Sv. 6 Aug 31, 2022
ObjectHydrator - Object Hydration library to create Command and Query objects.

Object Hydrator This is a utility that converts structured request data (for example: decoded JSON) into a complex object structure. The intended use

EventSauce 264 Dec 14, 2022
This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses and the like.

Simple PHP API v.1.0 This API aims to present a brief to consume a API resources, mainly for students in the early years of Computer Science courses a

Edson M. de Souza 14 Nov 18, 2021
微信支付 API v3 的 PHP Library,同时也支持 API v2

微信支付 WeChatPay OpenAPI SDK [A]Sync Chainable WeChatPay v2&v3's OpenAPI SDK for PHP 概览 微信支付 APIv2&APIv3 的Guzzle HttpClient封装组合, APIv2已内置请求数据签名及XML转换器,应

null 275 Jan 5, 2023