jaapz/tumblr
A Laravel/PHP package that wraps the Tumblr API, making it easier to query blogs, posts, and Tumblr data from your application through a simple, framework-friendly interface.
composer require jaapz/tumblr.config/services.php:
'tumblr' => [
'key' => env('TUMBLR_API_KEY'),
'secret' => env('TUMBLR_API_SECRET'),
],
$api = new \Jaapz\Tumblr\API(config('services.tumblr.key'));
$info = $api->getBlogInfo('staff.tumblr.com');
$feed = $api->getBlogPosts('staff.tumblr.com', ['limit' => 20]);
Before wiring anything else, read vendor/jaapz/tumblr/src — the package is small, so the entire public surface fits on one screen. Method names, return shapes (stdClass vs array), and whether OAuth is included are the details you need before designing around it.
TumblrServiceProvider and inject it into a TumblrService / TumblrRepository class. Controllers should never touch the raw client — you want a seam that makes it trivial to swap in raw Guzzle later.Cache::remember("tumblr:{$blog}:posts:{$offset}", 900, fn () => $api->getBlogPosts($blog, ['offset' => $offset, 'limit' => 20])); The rate limits justify it, and Tumblr responses are stable enough to cache for 10–15 minutes.tumblr:sync artisan command (scheduled in Kernel/Console\Kernel) iterating configured blog hostnames, dispatching SyncTumblrBlogJob per blog. Use Bus::batch() so failures are isolated per blog.blogs table, not scattered through code — mysite.tumblr.com is the API identifier, not the display name.total_posts and accepts offset + limit (max 20). Loop with offset += 20 until offset >= total_posts, but checkpoint the offset so a resumed job doesn't re-fetch everything.social_accounts-style table and sign requests yourself — the wrapper is primarily a read client.league/oauth1-client or hand-rolled signing.meta.status, not just HTTP status. Tumblr returns { meta: { status: 200, ... }, response: { ... } }. A 200 HTTP response can still wrap a 404 or 401 in meta.myblog.tumblr.com), not the display name or slug. Passing the wrong form yields silent 404s.content blocks, layout); older wrappers assume the legacy body / photos fields. Handle both, or rich content silently disappears.staff.tumblr.com for the read path; it's public and stable. For the write path, isolate the client behind an interface and mock that rather than the cURL layer.composer.lock is your friend; treat the package as a thin transport, not a domain layer.How can I help you explore Laravel packages today?