Download the PHP package asmaa-gamal/laravel-meta-messaging without Composer
On this page you can find all versions of the php package asmaa-gamal/laravel-meta-messaging. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asmaa-gamal/laravel-meta-messaging
More information about asmaa-gamal/laravel-meta-messaging
Files in asmaa-gamal/laravel-meta-messaging
Package laravel-meta-messaging
Short Description Send Facebook Messenger and Instagram messages from Laravel — every message type, with pre-flight validation and clear, structured errors.
License MIT
Homepage https://github.com/AsmaaGamal30/laravel-meta-messaging
Informations about the package laravel-meta-messaging
Laravel Meta Messaging
Send Facebook Messenger and Instagram messages from Laravel — every message type, with a fluent API, pre-flight validation, and errors that actually tell you what went wrong.
Why this exists
Calling Meta's Send API is easy. Understanding why it failed is not.
Neither says what to do. The first means the recipient blocked you, deleted the chat, or restricts third-party apps — permanently, for that person. The second could be almost anything; most often it is a message tag Meta retired on 27 April 2026 without changing the error response, so code that worked for years now fails with an error that never mentions tags.
This package turns those into:
and refuses the retired tag before spending an API call, naming the tag, the date, and the replacement.
Installation
Publish the config if you want to edit it:
Add your credentials to .env:
Requires PHP 8.2+ and Laravel 12 or 13.
Laravel 11 is not supported. It has reached end of life with open security advisories, so Composer refuses to install any 11.x release — there is no version of it this package could target safely.
Quick start
Templates
Every Messenger template type, composed from immutable value objects:
Also available: ButtonTemplate, MediaTemplate, ReceiptTemplate, ProductTemplate,
CustomerFeedbackTemplate. Buttons: UrlButton, PostbackButton, CallButton, LoginButton,
LogoutButton, GamePlayButton. See docs/templates.md.
Quick replies
Choosing the Graph API version
Globally in config, per account, or per call:
Per account, in config/meta-messaging.php:
Then Meta::facebook('legacy'). A malformed version is rejected immediately with an explanation
rather than becoming a confusing 404.
Multiple accounts and runtime tokens
Error handling
Two styles, same information.
Typed exceptions (default):
Structured results (never throws):
Access tokens are stripped from error context before it reaches your logs.
Every exception carries key(), hint(), apiCode(), subcode(), traceId(), channel(),
endpoint(), isRetryable(), context(), and toArray().
See docs/errors.md for the full error reference.
Caught before the network
These never cost you an API call or a rate-limit slot:
| Refused locally | Instead of Meta's |
|---|---|
| A retired message tag | (#100) Invalid parameter |
| A receipt template sent to Instagram | (#100) Invalid parameter |
| Text past the channel limit (1,000 IG / 2,000 FB) | (#100) Invalid parameter |
| More than 10 cards, 3 buttons, or 13 quick replies | (#100) Invalid parameter |
| A private reply carrying media | silent delivery of text only |
| Any Instagram reaction but ❤ | (#100) Invalid parameter |
| A missing or malformed credential | An access token is required |
Turn it off with META_VALIDATE=false if you ever need to.
Queueing
Validation still runs at the call site, so a malformed message fails immediately rather than on a worker. The job retries throttling and network faults with backoff, and fails permanent errors outright instead of burning attempts.
Events
MetaMessageFailed fires before any exception is thrown, so you can record delivery failures
without wrapping every send in a try/catch.
Testing
Simulate failures with the real error mapping:
Channel differences
| Messenger | ||
|---|---|---|
| Host | graph.facebook.com |
graph.instagram.com or graph.facebook.com |
| Text limit | 2,000 | 1,000 |
| Templates | generic, button, media, receipt, product, customer feedback | generic, button, product |
| Reactions | any emoji | ❤ only |
| Comment reply | /{comment-id}/comments |
/{comment-id}/replies |
| Reusable uploads | yes | no |
| Message tags, personas | yes | no |
Anything a channel lacks is refused locally with a message naming the alternatives.
Documentation
- Configuration
- Sending messages
- Templates and buttons
- Comments and private replies
- Error reference
- Testing
Contributing
Bug reports and pull requests are welcome — see CONTRIBUTING.md. New Meta
error codes are especially welcome; adding one is a single line in ErrorCatalog.
Contact
Built and maintained by Asmaa Gamal.
- 📧 Email — [email protected]
- 💼 LinkedIn — linkedin.com/in/asmaagamal30
- 🐙 GitHub — @AsmaaGamal30
For bugs and feature requests, please open an issue rather than emailing — it keeps the answer where the next person will find it. Email and LinkedIn are best for consulting enquiries or anything you would rather not discuss in public.
License
MIT. See LICENSE.md.
All versions of laravel-meta-messaging with dependencies
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0