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

Php Business Sdk Laravel Package

facebook/php-business-sdk

The Facebook Business SDK for PHP bundles multiple Facebook APIs, including Marketing, Pages, Business Manager, and Instagram, into one SDK to simplify implementation and ongoing maintenance for partners serving business clients.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for Meta ads functionality. This is Meta's own SDK, so the realistic decision isn't "SDK vs. nothing" — it's "official SDK vs. hand-rolled Graph API client vs. buying an ads-management vendor." The SDK removes roughly the cost of writing and maintaining typed request/response plumbing for the Marketing API, which usually shifts the buy-vs-build line toward building the product surface.
  • Roadmap: server-side conversion tracking. The bundled Conversions API client plus the Parameter Builder (auto-filling fbc/fbp/client_ip_address/event_source_url/referrer_url, with non-destructive gating via Preference and automatic SHA-256 normalization/hashing of customer PII) is the single highest-leverage capability here. If server-side events are on the roadmap because of cookie deprecation and ad-blocking, this materially shortens that epic and reduces the chance of shipping a non-compliant payload.
  • Feature scope for an ads management surface. Object classes and cursor pagination cover the full CRUD loop — read accounts/campaigns/adsets/ads, create with budgets and targeting, update bids and names, delete, and page through large result sets. That supports concrete features: reporting dashboards, bulk budget/bid edits, creative and audience management, lead-form retrieval, and Pages/Instagram publishing.
  • Reporting freshness and SLA commitments. Cursors default to explicit fetching (implicit fetching is opt-in), which means request volume — and therefore latency and rate-limit exposure — is a design choice, not an accident. This directly informs what you can promise customers about sync cadence and backfill, and should be decided before pricing tiers are set.
  • Rate-limit and quota modeling → plan limits. Marketing API limits are per ad account and per tier. The SDK gives you a clean cursor boundary to instrument, which is exactly where you'd enforce per-tenant sync budgets. Treat this as an input to packaging, not an engineering afterthought.
  • Multi-tenant OAuth and token lifecycle as a first-class product concern. The SDK is token-first (Api::init($app_id, $app_secret, $access_token)) with a singleton; it does not manage token expiry, refresh, or per-tenant isolation. Plan for a "connection health / reauth required" surface in the product — this is where most ads integrations generate support tickets.
  • App Review as a timeline dependency. Requesting ads_management, ads_read, business_management, manage_page etc. requires Meta review, which is measured in weeks and can gate a launch. Flag this in the release plan now, not at QA.
  • Data ownership boundary. The SDK gives you API access, not analytics. A warehouse/ETL layer and a semantic model for spend, impressions, and attribution are still yours to build — budget for them separately so the SDK isn't mistaken for a reporting solution.

When to Consider This Package

Adopt it when:

  • The stack is PHP 8.0+ / Laravel and you want a single dependency covering Marketing API, Pages, Business Manager, and Instagram rather than stitching several integrations.
  • You need Conversions API with correct PII hashing and click-ID capture — the bundled Parameter Builder is a genuine accelerator and hard to replicate correctly.
  • Breadth matters: multiple ad object types, pagination, and enum-like field classes reduce the surface area of your own code.
  • You can accept a codegen-generated dependency and pin/upgrade it deliberately.
  • Legal has cleared the license (see caveat below).

Look elsewhere when:

  • You only need Facebook Login. laravel/socialite plus a couple of Graph calls is far less surface area.
  • You only need Conversions API. A dedicated CAPI client or a tag-server vendor is a smaller footprint than pulling in the whole business SDK.
  • You need stable semantic versioning and predictable upgrade notes. This SDK is autogenerated from Meta's codegen repo; releases track upstream spec changes rather than a curated API. Version pinning and regression testing are on you.
  • You require vendor support commitments. Issue reporting was moved off GitHub to a dedicated channel, so public triage and community-fix velocity are limited — and locally patching generated code doesn't survive the next release.
  • The need is narrow — one or two endpoints and a handful of fields. Http::withToken(...) is less code than learning the object model.
  • You need guaranteed test coverage of your integration. Meta's own CI runs unit tests only and explicitly cannot run integration tests publicly, so contract testing against a sandbox ad account is your responsibility.
  • You need heavy analytics. Sync to a warehouse and query there; don't build reporting off live paginated API calls.

Two caveats worth raising before adoption:

  1. License is NOASSERTION on the registry but reads as the Facebook Platform License. Standard OSS policy checks may block it automatically — get a legal read early rather than discovering it during a security review.
  2. Coupling risk. Because it's official and generated, you can't fork your way out of a problem. Mitigate with a thin internal adapter (your own AdsClient contract) so the SDK is swappable and mockable in tests.

How to Pitch It (Stakeholders)

For executives: Meta publishes and maintains this SDK, and it's free under Composer. It replaces the plumbing work of talking to the Marketing API — accounts, campaigns, budgets, reporting, plus server-side conversion tracking with Meta's current PII-hashing requirements — with a supported dependency. The pitch is time-to-market on Meta integration and a lower chance of shipping a non-compliant tracking payload, not a new capability we couldn't otherwise build. Two risks to name honestly: the license needs a legal review, and support is vendor-directed with no SLA. Both are mitigated by keeping our own thin layer over it so we're not locked in.

For engineering: composer require facebook/php-business-sdk, PSR-4, PHP 8.0+. You get typed object classes, field-name enums to avoid stringly-typed bugs, bidirectional cursors with explicit fetching by default, and a CurlLogger that prints the exact equivalent cURL for support escalation. The Conversions API client bundles the Parameter Builder so fbc/fbp/IP/referrer auto-fill from the request context (Laravel: $request->server->all()) and is non-destructive — values you set are never overwritten. Plan for: wrapping it behind our own interface, owning integration tests against a sandbox ad account since upstream CI is unit-only, pinning versions because releases are codegen output, and managing token isolation ourselves — the Api object is a singleton, which is a real hazard in a multi-tenant Laravel app.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib