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

Twitter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

This package makes it easy to send notifications via Twitter with Laravel

Frequently asked questions about Twitter
How do I install laravel-notification-channels/twitter in a Laravel app?
Add it with Composer using composer require laravel-notification-channels/twitter. Before installing, run composer why abraham/twitter to see which major of the OAuth client your application resolves, because the package major you can use depends on it. Then add your X credentials to config/services.php and implement toTwitter() on the notification classes that should post. There are no migrations, models, or published config files to manage, so setup is limited to the dependency and the credentials block.
How do I send a tweet from a Laravel notification?
Add a toTwitter() method to your notification class and return a TwitterMessage value object describing the post. Register twitter in the notification's via() method so Laravel's Notification::send() fan-out includes the channel alongside mail, Slack, or SMS. Because the message is a value object, the payload formatting stays contained and testable outside the API call.
How do I configure Twitter API credentials for this notification channel?
Configuration is a credentials block in config/services.php, populated from environment variables so secrets stay out of source control. The package uses app-level OAuth 1.0a with user context, meaning it posts as a single account rather than as each individual end user. You also need an X developer account with an app that has write permissions and an API tier sufficient for your intended volume.
How do I route Twitter notifications to a specific account or handle?
Add a routeNotificationForTwitter() method to your notifiable model, following the same pattern as other Laravel notification routing methods. For one-off recipients you can use on-demand notifications instead of storing a route on the model. The package then posts from the configured brand account and mentions the notifiable's handle, so per-post targeting beyond a mention is not supported.
Which version of this package supports abraham/twitter 7.x?
Version 8.3.0 dropped support for abraham/twitter 7.0 and is a dependency-support change only, with the channel contract, config shape, and message object untouched. Developers who need the 7.x OAuth client are directed to the parallel 9.x line of this package rather than 8.3.0. The maintainer now splits support across package majors, so run composer why abraham/twitter first and treat every release as changelog-mandatory because version numbers here do not reliably signal breaking change.
Does this package support queued and on-demand notifications?
Yes. It is a standard Laravel notification channel, so it works with queued notifications and the usual ShouldQueue behaviour, and it also supports on-demand notifications sent through Notification::route(). The channel itself is stateless, with no queue tables or persistence, so queueing is handled entirely by Laravel's existing notification dispatch model.
Can this package send direct messages or post as the end user?
It integrates tweets and direct messages into Laravel's notification system through the Twitter API. However, the credential model is app-level OAuth 1.0a user context, so it posts as one configured account and mentions the notifiable's handle. Posting as the end user would require per-user OAuth token storage and a fork or wrapper around the package.
What are the rate limit and X API pricing concerns for production?
X has repeatedly re-tiered and re-priced its API, and free-tier write volume is a hard monthly cap in the hundreds of posts, not thousands. Any design treating X as an unbounded notification sink will hit a paywall or a 429 within the first sprint, so budget approval for an API tier is usually the critical path rather than engineering effort. Automated posting is permitted within limits, but spam and duplication rules are enforced opaquely and a suspension takes the channel offline with no code fix.
How do I test Twitter notifications without calling the real API?
Use Laravel's Notification::fake() and assert the notification was sent to the expected notifiable or on-demand route. Because the message is a TwitterMessage value object, you can also assert the payload formatting in isolation without touching the network. Feature tests covering the routing method and the channel selection give good coverage for what is a thin adapter over the Twitter API.
Is this package actively maintained, and what are the alternatives?
It has around 176 stars and effectively zero recorded dependents, so there is little public production validation, no first-party backing, and no security-response process. The codebase is small enough to fork and own, which caps the downside. If you want fewer moving parts, call abraham/twitter directly from a service class, or keep X behind an existing channel such as mail or Slack for alerting. Also watch the parallel major lines, since the branch you sit on may stop receiving upstream API fixes.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections