laravel-notification-channels/twitter
Send Twitter notifications from Laravel using this notification channel. Integrate tweets and direct messages into Laravel’s notification system via the Twitter API, with a simple channel driver for queued or on-demand notifications.
Architecture fit
NotificationChannel contract as a thin adapter over the X/Twitter API. It slots into the existing Notification::send() fan-out, so a team already using mail/Slack/SMS channels adds X as another channel with no change to the notification dispatch model.config/services.php plus a routeNotificationForTwitter() resolver on the notifiable. This is the lowest-coupling integration shape available in the Laravel ecosystem.TwitterMessage), which keeps payload formatting testable and contained. Fit is good for transactional, low-volume outbound posts (release announcements, status updates, alert escalations).Integration feasibility
toTwitter() on one or two notification classes, add the routing method, write feature tests.abraham/twitter major your application resolves. v8.3.0 drops support for abraham/[email protected]; anyone needing 7.x is directed to the parallel v9.0 line of this package. Before anything else, run composer why abraham/twitter — if our app or any other dependency pins ^7.0, we are either stuck on ≤8.2.x or forced into a transitive upgrade.Technical risk
^8.0-style constraints and routine composer update runs can alter the resolved dependency graph underneath us. Treat every release, however numbered, as changelog-mandatory.Key questions
abraham/twitter major is in our lockfile today, why is it there, and are we free to move to 9.x? If not, we are committing to a soon-to-be-legacy branch of this package.Stack fit
illuminate/notifications and illuminate/support; verify against our pinned Laravel and PHP versions before committing. Underlying HTTP is handled by abraham/twitter — treat that as a first-class transitive supply-chain item to scan and pin, not background noise..env files. Four secrets (consumer key/secret, access token/secret) plus the target account identity.ShouldQueue on the notification so the HTTP call is off the request path and subject to queue retry/backoff policy.Migration path
SocialPublisher interface with the X channel as one implementation. This costs an hour and buys the ability to swap providers or add Threads/Bluesky/Mastodon without touching domain notification classes. It also insulates us from churn in this package's major-version lines.Compatibility
8.3.0, not ^8.0), and gate upgrades behind a staging soak. v8.3.0 is the evidence: a dependency-support removal landed without a major version bump, so range constraints do not convey the safety they normally would.abraham/twitter 8.x/9.x, or remain on a pre-8.3.0 release pinned against abraham/twitter 7.x. Record the choice in the ADR so the next engineer doesn't discover it via a failed composer update.Sequencing
abraham/twitter version question and pick the package line. Everything downstream depends on it.SocialPublisher wrapper plus one real notification; add queueing, throttling, and structured logging of API responses.Maintenance
composer update that touches this package or abraham/twitter.Support
Scaling
Failure modes
429 Too Many Requests — most common; must be handled by queue backoff, not by user-visible error.401/403 — credential revocation, permission downgrade, or account restriction. Requires an alert, not a retry loop.composer update. Deploys must run against a committed lockfile, and CI must fail loudly rather than auto-resolve.abraham/twitter API surface at call time. Covered only by integration tests that exercise the real client path.Ramp-up
How can I help you explore Laravel packages today?