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 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' => 'rafael@email.com.br',
		'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('rafael@email.com.br')
	)
);

$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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
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
spatie/mailcoach-vapor