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

Birthday for the Facebook SDK for PHP

Extends \DateTime and represents a user's birthday returned from the Graph API which can be returned omitting certain information.

Users may opt not to share birth day or month, or may not share birth year. Possible returns:

  • MM/DD/YYYY
  • MM/DD
  • YYYY

Facebook\GraphNode\Birthday

After retrieving a GraphUser from the Graph API, the getBirthday() method will return the birthday in the form of a Facebook\GraphNode\Birthday entity which indicates which aspects of the birthday the user opted to share.

The Facebook\GraphNode\Birthday entity extends DateTime so format may be used to present the information appropriately depending on what information it contains.

Usage:

$fb = new Facebook\Facebook(\* *\);
// Returns a `Facebook\Response` object
$response = $fb->get('/me');

// Get the response typed as a GraphUser
$user = $response->getGraphUser();

// Gets birthday value, assume Graph return was format MM/DD
$birthday = $user->getBirthday();

var_dump($birthday);
// class Facebook\GraphNode\Birthday ...

var_dump($birthday->hasDate());
// true

var_dump($birthday->hasYear());
// false

var_dump($birthday->format('m/d'));
// 03/21

Instance Methods

hasDate()

public boolean hasDate()

Returns whether or not the birthday object contains the day and month of birth.

hasYear()

public boolean hasYear()

Returns whether or not the birthday object contains the year of birth.

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky