Weave 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 Api Laravel Package

silici0/facebook-api

View on GitHub
Deep Wiki
Context7

Laravel integration for Facebook API

This library provides an objected-oriented wrapper of the PHP classes to send CRM Integration with Facebook API

Installation

composer require silici0/facebook-api:dev-master

Publish Conf File

php artisan vendor:publish --provider="silici0\FacebookApi\FacebookApiServiceProvider"

Configuration

You need pixel_id and acesss_token to update your .env file with the follow options:

FACEBOOK_PIXEL_ID='ID'
FACEBOOK_ACCESS_TOKEN='TOKEN'

Send Test Event

Get your event test code and fill like the example below:

use silici0\FacebookApi;

$fb = new \FacebookApi();

$response = $fb::sendTest('TEST57893');

$msg = $response->getMessages();
$eventsReceived = $response->getEventsReceived();
$fbTraceId = $response->getFbTraceId();

Send CRM Integration

To send CRM Integration you need send a Deduplication hash as event ID, so facebook can identify your browser pixel with your server Pixel:

$fb = new \FacebookApi();

$data[] = array(
	'user' => array(
		'id' => '1',
		'email' => '[email protected]',
		'first_name' => 'rafael',
        'phone' => '1155994267171'
	),
	'custom' => array(
		'lead_event_source' => 'In-house CRM',
		'event_source' => 'crm'
	),
	'event' => array(
		'name' => 'Evento Lead',
		'unixtimestamp' => time(),
        'id' => Hash::make('[email protected]')
	)
);

$response = $fb::sendCRM($data);
foreach ($response as $key => $value) {
    print("<pre>".print_r($value,true)."</pre>");
}
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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels