Download the PHP package jkudish/plume without Composer
On this page you can find all versions of the php package jkudish/plume. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jkudish/plume
More information about jkudish/plume
Files in jkudish/plume
Informations about the package plume
Plume
X (Twitter) API v2 client for Laravel.
Plume wraps the entire X API v2 behind a clean Laravel facade. Typed DTOs, automatic pagination, user-scoped operations, OAuth token refresh, rate-limit handling, test fakes with semantic assertions, 41 artisan commands, and 15 AI tools for the Laravel AI SDK.
Install
Add to .env:
Quick Start
Why Plume?
Most X API libraries for PHP are either stuck on API v1.1, aren't Laravel-native, or lack the DX features that make building with the API pleasant.
| Feature | Plume | abraham/twitteroauth | noweh/twitter-api-v2-php |
|---|---|---|---|
| X API v2 | Full coverage | Partial | Partial |
| Laravel facades | Yes | No | No |
| Typed DTOs | Active Record methods | Arrays | Arrays |
| Test fakes | Semantic assertions | No | No |
| OAuth auto-refresh | Built-in | Manual | Manual |
| Artisan commands | 41 commands | No | No |
| AI tools (Laravel AI SDK) | 15 tools | No | No |
| Pagination | Automatic | Manual | Manual |
| Rate-limit handling | Structured exceptions with retry timing | Manual | Manual |
Plume is designed to be the canonical X API package for Laravel: typed, testable, and ready for both CLI and AI agent use.
What's Covered
Every endpoint in the X API v2:
| Domain | Methods |
|---|---|
| Posts | createPost, deletePost, getPost, getPosts, hideReply, unhideReply |
| Timelines | userTimeline, mentionsTimeline, homeTimeline |
| Search | searchRecent, searchAll, countRecent, countAll |
| Users | getUser, getUsers, getUserByUsername, getUsersByUsernames, me, searchUsers |
| Likes | like, unlike, likingUsers, likedTweets |
| Retweets | retweet, undoRetweet, retweetedBy, quoteTweets |
| Bookmarks | bookmark, removeBookmark, bookmarks |
| Follows | follow, unfollow, followers, following |
| Blocks | block, unblock, blockedUsers |
| Mutes | mute, unmute, mutedUsers |
| Lists | createList, updateList, deleteList, getList, ownedLists, listTweets, listMembers, listFollowers, addListMember, removeListMember, followList, unfollowList, pinList, unpinList |
| Media | uploadMedia, initChunkedUpload, appendChunk, finalizeUpload, uploadStatus, setMediaMetadata |
All methods are fully typed with enums for field selection (TweetField, UserField, Expansion, etc.) and return typed DTOs (Post, User, XList, PaginatedResult).
Key Features
Typed DTOs with Active Record Methods
Automatic Pagination
User-Scoped Client
ScopedXClient operates on behalf of a specific user. No more passing $userId to every call.
Implement HasXCredentials on your User model:
OAuth 2.0 with Auto-Refresh
Plume handles token refresh automatically on 401 responses. Persist refreshed tokens with a callback:
Rate-Limit Awareness
Plume throws a structured RateLimitException on 429 responses with built-in retry timing:
All exceptions include rate-limit headers (x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset) when available.
Media Upload
Test Fakes
X::fake() swaps the client with an in-memory fake that records all calls:
Semantic assertions: assertPostCreated, assertPostDeleted, assertLiked, assertRetweeted, assertBookmarked, assertFollowed, assertBlocked, assertMuted, assertRepliedTo, assertSearched, assertNothingPosted, assertNothingCalled, assertForUserCalled.
Artisan Commands
Plume ships 41 artisan commands for full CLI access to the X API. All commands support --format=json for machine-readable output where applicable.
| Category | Commands |
|---|---|
| Profile | plume:me |
| Posts | plume:post, plume:get-post, plume:delete-post |
| Search | plume:search |
| Timelines | plume:home, plume:timeline, plume:mentions |
| Users | plume:user |
| Likes | plume:like, plume:unlike, plume:likes |
| Retweets | plume:retweet, plume:unretweet |
| Follows | plume:follow, plume:unfollow, plume:followers, plume:following |
| Bookmarks | plume:bookmark, plume:unbookmark, plume:bookmarks |
| Blocks | plume:block, plume:unblock, plume:blocked |
| Mutes | plume:mute, plume:unmute, plume:muted |
| Media | plume:upload |
| Lists | plume:lists, plume:lists:create, plume:lists:get, plume:lists:delete, plume:lists:update, plume:lists:members, plume:lists:add-member, plume:lists:remove-member, plume:lists:tweets, plume:lists:follow, plume:lists:unfollow, plume:lists:pin, plume:lists:unpin |
Commands that modify state (plume:delete-post, plume:unfollow, plume:block, plume:unblock, plume:mute, plume:unmute, plume:lists:delete, plume:lists:remove-member) prompt for confirmation. Pass --force to skip.
AI Tools
Plume ships 15 tools for the Laravel AI SDK 1.0.1+ (requires PHP 8.3+ and Laravel 12+). Install laravel/ai to use them:
Tools are tagged as ai-tools and implement Laravel\Ai\Contracts\Tool:
plume:fetch-tweet, plume:post-tweet, plume:search, plume:home-timeline, plume:my-timeline, plume:mentions, plume:like, plume:retweet, plume:bookmark, plume:bookmarks, plume:follow, plume:followers, plume:following, plume:profile, plume:upload-media
Requirements
- PHP 8.2+ (AI tools require PHP 8.3+ and Laravel 12+)
- Laravel 11 or 12
Contributing
See CONTRIBUTING.md. Run composer test, composer phpstan, and composer lint before submitting.
Security
Email [email protected] to report vulnerabilities. See SECURITY.md.
Sponsoring
If you find Plume useful, consider becoming a sponsor.
License
MIT. See LICENSE.
All versions of plume with dependencies
illuminate/http Version ^11.0 || ^12.0
illuminate/support Version ^11.0 || ^12.0