A set of helpers to communicate with the Facebook Messenger Platform
Via Composer
$ composer require madewithlove/facebook-messenger-platform
This package assumes you have followed the getting started guide and have received an access token for the Facebook page.
use Madewithlove\FacebookMessengerPlatform\Api\HttpClient;
use Madewithlove\FacebookMessengerPlatform\Api\Client;
$httpClient = new HttpClient('your_access_token');
$client = new Client($httpClient);
$client->send()->message('recipient_id', 'hello world');
$client->send()->image('recipient_id', 'http://url-to-image.com');
Takes the recipient ID and an array of elements. Refer to the documentation for what the elements can consist of.
$client->send()->generic('recipient_id', []);
Takes the recipient ID, an array of buttons and a text. Refer to the documentation for what the elements can consist of.
$client->send()->buttons('recipient_id', []);
Takes the recipient ID and an payload for the receipt. Refer to the documentation for what the receipt can consist of.
$client->send()->buttons('recipient_id', []);
- Welcome message configuration
- User Profile
$ composer test
The MIT License (MIT). Please see License File for more information.