mortezamasumi/fb-message
A Laravel package that makes it easy to send Facebook Messenger messages through the Graph API. It offers a simple, configurable interface for integrating Facebook messaging into your PHP applications, with straightforward setup and seamless Laravel integration.
composer require mortezamasumi/fb-message. v5.2.0 adds Laravel 13 support; the package tracks Laravel's major releases closely, so pin to ^5.2 if you're on Laravel 13 and to ^5.1 on Laravel 11/12 if you want to defer the upgrade.php artisan vendor:publish --tag=fb-message-config. This is the single most important file — it holds the page access token, app secret, verify token, and webhook path..env (FB_PAGE_ACCESS_TOKEN, FB_VERIFY_TOKEN, FB_APP_SECRET) rather than editing the config directly, so per-environment pages work without code changes..env for the subscription handshake.hub_challenge, then reply to an incoming messages event with a plain text send. Once that round-trips, everything else (templates, buttons, attachments) is incremental.200 immediately. Facebook retries aggressively on slow responses, and retries plus a synchronous handler means duplicate replies.message, postback, quick_reply, and optin payloads to small dedicated classes. A single switch on entry[0].messaging[0] grows into an unmaintainable blob within a week.Messenger service or a Laravel notification channel. When you need to add multi-page routing or a fallback provider, you change one class instead of fifty call sites.Redis::throttle or rate-limited queue middleware keyed by page ID is cheap insurance.Http::fake(). Assert on the outgoing request body rather than mocking the package internals — the payload shape is the actual contract with Meta, and it's what silently breaks between versions.expose or ngrok and keep a scratch Meta app separate from production. Webhook subscriptions are sticky and easy to break for real users while debugging.X-Hub-Signature-256 against the raw body. Using $request->all() re-encoded will not match. Read getContent() before any middleware mutates it.200 even on internal errors you've already logged — or better, only for events you've durably queued. Non-200 responses trigger retries and eventual subscription disablement.Http::fake() assertions after upgrading; framework major bumps occasionally change how the HTTP client serializes payloads.php artisan config:cache freezes the token; a .env change without re-caching silently does nothing.debug level with a short retention. When Meta changes a field or adds a new event type, that log is the only evidence you'll have.composer update.How can I help you explore Laravel packages today?