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

Messenger Laravel Package

kerox/messenger

Kerox Messenger is a flexible PHP library for adding private messaging to your app. It provides threads, participants, and messages out of the box, with a storage-agnostic design, Doctrine support, and optional Laravel integration for quick setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Framework-agnostic PHP library built around a client class that wraps the Facebook Messenger (Meta Graph) Platform APIs; it does not ship a Laravel service provider, facade, or config publishing, so it slots into Laravel as infrastructure, not as a first-class package.
  • Fits cleanly behind a domain boundary: define an internal MessengerGateway interface and implement it with this library, so controllers/jobs never touch the vendor API directly. This preserves the option to swap for the official Facebook SDK or raw Graph calls later.
  • Intended surface is the Send API (text, attachments, templates, buttons, quick replies, sender actions), User Profile API, and Messenger Profile management. Webhook handling/signature verification must be validated before relying on it.
  • Stateless client → compatible with Laravel Octane and horizontal scaling; no long-lived connections or in-memory state to worry about.

Integration feasibility

  • Composer install is straightforward, but the library depends on PSR-18/PSR-17 HTTP abstractions and discovery. A concrete client (Guzzle, or Symfony HTTP Client with a PSR-18 adapter) must be present — verify php-http/discovery behavior in the app's dependency graph.
  • Typical wiring: bind a singleton in AppServiceProvider (or a dedicated provider) constructed from config('services.messenger.page_token') and app secret; no package config file exists, so configuration lifecycle is entirely yours.
  • PHP version constraint of the latest 2025 release must be checked against the target Laravel version (Laravel 10/11 require PHP 8.1/8.2).
  • Outbound is simple; inbound webhooks are the higher-effort half — verification challenge, X-Hub-Signature-256 validation, payload parsing, and 200-response discipline are application responsibilities unless the package covers them.

Technical risk

  • Bus factor / adoption: 58 stars, 0 dependents, effectively a single-maintainer project. Low adoption means fewer battle-tested edge cases and no ecosystem of answers.
  • API drift: Meta deprecates Graph API versions on a rolling cadence. If the package pins a version that is not configurable, upgrades become forced and may lag.
  • Policy surface: Messenger is governed by platform policy (24-hour messaging window, message tags, app review, page permissions) that no library can abstract away — most production failures will be policy/token issues, not code issues.
  • Abstraction leakage: Meta error semantics (codes 190 invalid token, 613/2018001 rate limit, 10 permission) need explicit mapping; a thin wrapper often surfaces raw responses, so error handling lands on your code.

Key questions

  • Which Graph API version does the client target, and is it configurable per instance?
  • Does it verify X-Hub-Signature-256 and parse webhook entry/messaging arrays, or is that entirely on us?
  • Are raw HTTP responses and Meta error codes exposed for structured exception mapping?
  • Does it support batch requests, message tags, handover protocol, and persistent menu/ice breakers we plan to use?
  • What is the exact PHP + PSR dependency matrix, and does it conflict with our Guzzle version?
  • Is there a documented BC policy and recent commit activity beyond the 2025-01 release?

Integration Approach

Stack fit

  • Laravel 10–12, PHP 8.2+, Guzzle (already transitively present in most Laravel apps) as the PSR-18 implementation.
  • Register one singleton per page/app credential set; if multi-tenant (multiple Facebook Pages), key the binding by page ID and resolve per tenant rather than a single global token.
  • Do not call the client from controllers; wrap send operations in queued jobs so retries and backoff are owned by Laravel's queue, not the vendor HTTP layer.

Migration path

  • If already on BotMan or the official Facebook SDK, migrate incrementally: keep the existing webhook endpoint stable, re-implement outbound message builders against this library behind the MessengerGateway interface, and cut over per message type.
  • If no prior integration exists, spike with this library but retain a thin native Graph fallback for message types the package does not model — avoid fork pressure early.
  • Normalize inbound webhook payloads into internal events (MessageReceived, PostbackReceived, ReferralReceived) at the boundary; this is the durable asset and makes the library replaceable.

Compatibility

  • Confirm the library's Guzzle/PSR-7 constraints resolve against the locked dependency set; run composer why-not during the spike.
  • php-http/discovery may auto-select an adapter — pin the intended client explicitly to avoid environment-dependent behavior across local/CI/production.
  • No Laravel version coupling (it is not a Laravel package), so upgrades are Composer-level only; no framework hooks to break.

Sequencing

  1. Env/config + singleton binding + contract interface; smoke-test a text send to a real page.
  2. Webhook endpoint: verification handshake, signature validation, idempotent event persistence, fast 200 + queued processing.
  3. Outbound messaging with retry/backoff, structured error mapping, and dead-letter handling.
  4. Rich payloads: templates, buttons, quick replies, attachments.
  5. Messenger Profile automation (persistent menu, greeting, ice breakers) as deploy-time tasks.
  6. Observability: per-call logging, token/version tags, rate-limit metrics, alerting.

Operational Impact

Maintenance

  • Low release cadence but a recent (2025-01) release is a positive signal; still, plan for the possibility of abandonment.
  • Mitigation: pin an exact version, wrap behind an interface, and keep an internal fork path. Budget ~1–2 days per quarter to audit upstream and Meta Graph version deprecations.
  • Token lifecycle is the recurring operational task: long-lived page token issuance, rotation, and secure storage (secrets manager, not .env in production at scale).

Support

  • No commercial support; GitHub issues from a single maintainer. Internal runbook and code ownership are mandatory.
  • Expect Meta-side support (app review, permission escalations, policy appeals) to dominate support load rather than library issues.

Scaling

  • Throughput is bounded by Meta rate limits (per-page and per-app), not by PHP. Queue outbound sends with rate limiting (Laravel RateLimiter or Redis::throttle) and exponential backoff on 613/2018001.
  • Webhook receivers must respond within seconds and tolerate bursty redelivery; process asynchronously and keep handlers idempotent on mid/message ID.
  • Stateless design scales horizontally without session affinity.

Failure modes

  • Expired/revoked page token → all sends fail with 190; needs alerting and a rotation runbook.
  • Rate limiting and throttling → silent queue backlogs; instrument queue depth and 613 frequency.
  • 24-hour window / message tag violations → 10 or policy errors that look like code bugs; document the rules where message builders live.
  • Duplicate webhook deliveries → double replies; enforce idempotency keys on inbound message IDs.
  • Signature mismatch or verification challenge misconfiguration → Meta disables the webhook silently; monitor subscription health.
  • Graph version deprecation → sudden 400s after a Meta cutoff date; track the pinned version in a dashboard.
  • Network timeouts / non-2xx responses → ensure the wrapper distinguishes retryable (5xx, timeout) from terminal (4xx) failures.

Ramp-up

  • Small API surface; a competent Laravel developer can complete steps 1–3 in 2–4 days, with rich payloads and profile automation adding another 2–3 days.
  • The real lead time is Meta-side: app setup, page permissions, and app review — plan weeks, not days, for production access to non-test users.
  • Given the low adoption and score, treat this as a tactical accelerator rather than a strategic dependency: acceptable for a contained Messenger integration, not for a platform-wide channel strategy without the interface isolation described above.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core