ka4ivan/laravel-notification-channel-instagram
Send Laravel notifications through Instagram Messenger with this channel. Install via Composer, configure your Instagram API version, access token, and profile ID in services.php, then set start buttons using the provided Artisan command.
Architecture fit: The package is a thin adapter between Laravel’s notification abstraction and the Instagram Messaging API, so it slots into an existing Notification + via() architecture without introducing a new messaging platform, queue system, or data store. TPM leverage is highest when Instagram is modeled as an additional outbound engagement channel alongside email/SMS/push, reached through the same notifiable model and routeNotificationForInstagram() routing the team already understands. It fits poorly as a foundation for a conversational product: there is no webhook/inbound handler, no conversation state, no inbox, and no analytics.
Scope the package actually delivers: Outbound text messages, single and multi-attachment sends (attach, attachMany with AttachmentType::IMAGE|AUDIO|VIDEO), up to three call-to-action buttons (web_url, postback), per-message overrides for API version, access token, and profile ID, plus an Artisan command (instagram:set-start-buttons) to register ice-breaker start buttons. This is a legitimate MVP feature set for notifications, reminders, and promotions — it is not a customer-support stack.
Integration feasibility: Low engineering effort. Installation is composer require, credentials live in config/services.php under an instagram key fed by INSTAGRAM_API_VERSION / INSTAGRAM_ACCESS_TOKEN / INSTAGRAM_PROFILE_ID, and usage is a normal notification class returning InstagramMessage::create()->text(...). The changelog shows steady, small releases through 1.3.1 with Laravel 13 support, indicating the maintainer tracks framework upgrades. The real effort is not code — it is Meta-side: Instagram professional account, Meta app, correct messaging permissions, token issuance/refresh, and (for production access) platform review.
Technical risk: Material, and mostly external to the package.
retryUntil, failed() hooks, monitoring).Key questions for engineering before approval:
graph.instagram.com (Instagram Login) or graph.facebook.com (Facebook Login)? This determines the app type, permission set, and token lifecycle we must provision.false, or logged-only? Does a failed notification fail the job and retry, or disappear?RateLimited middleware or a Redis throttle per profile ID?attachMany send one message or N messages, and how does that interact with ordering and rate limits?.env?Stack fit: Best fit is a Laravel 9–13 monolith or modular monolith already using notifications for transactional and lifecycle messaging. The channel is stateless and configuration-driven, so it introduces no schema changes and no new infrastructure — only outbound HTTPS calls from queue workers. Teams on multi-tenant or multi-brand setups should note the config is effectively single-profile by default; per-message setProfileId()/setAccessToken() overrides make multi-profile possible, but credential resolution then becomes application logic we own.
Migration path: There is nothing to migrate. This is additive: add the package, add the instagram block to config/services.php, store credentials per environment, add an instagram_id column (or equivalent) to the notifiable, implement routeNotificationForInstagram(), and opt notifications in one at a time via via(). Existing email/SMS/push channels are untouched, which makes rollback a one-line change per notification class.
Compatibility: Verify three things explicitly rather than assuming: (a) the Laravel and PHP versions in use versus the package’s supported matrix; (b) Guzzle/HTTP client version alignment with the rest of the app, and whether the package uses Laravel’s HTTP client or Guzzle directly so global HTTP middleware (logging, retries, proxy) applies; (c) the default Graph API version (22.0) against Meta’s current version and deprecation schedule. Also confirm the Artisan command works in the deployment model — no interactive prompts, correct config caching — and that InstagramMessage serializes cleanly for queued notifications.
Sequencing:
routeNotificationForInstagram() on a test notifiable.Maintenance: Single maintainer, low activity, small codebase. Pin the version and monitor the changelog and upstream repo. Consider forking or vendoring if the channel becomes critical. Budget for periodic compatibility checks with Laravel and Graph API versions. The package’s small surface area makes forking feasible.
Support: No vendor support; community-only via GitHub issues. Internal team must own Meta app review, permissions, token lifecycle, and policy compliance. TPM should assign an owner for the Meta developer account and token rotation.
Scaling: Outbound only; scales with queue workers and Meta API rate limits. The Instagram Messaging API has per-profile rate limits and messaging-window constraints. Need queue throttling, backoff, and possibly multiple profiles/tokens for volume. No built-in batching; attachMany may amplify calls. Monitor 429s and error rates. For high volume, consider a central notification service or direct API integration to control payloads and retries.
Failure modes:
Ramp-up: Low for Laravel developers: familiar notification pattern, fluent message builder, README adequate for basic use. Moderate for Meta platform: requires understanding the Instagram Messaging API, permissions, app review, token types, and messaging policies. Plan for a 1–2 day spike for a developer familiar with Laravel but new to Meta, plus time for app review (days to weeks) if production access is needed. Documentation is README-only; no inline API docs or visible tests. Onboarding should include a runbook for credentials and failure handling.
How can I help you explore Laravel packages today?