jeffersongoncalves / laravel-buffer
PHP/Laravel client for the Buffer (bufferapp.com) REST API v1: user, profiles, and scheduled/pending/sent updates.
Package info
github.com/jeffersongoncalves/laravel-buffer
pkg:composer/jeffersongoncalves/laravel-buffer
Fund package maintenance!
Requires
- php: ^8.2
- illuminate/http: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.21
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel Buffer
A Laravel client for the Buffer (bufferapp.com) REST API v1. Manage the authenticated user, connected social profiles, and pending/sent/scheduled updates through a simple, resource-based API, authenticated via a Bearer access token.
Installation
You can install the package via composer:
composer require jeffersongoncalves/laravel-buffer
You can publish the config file with:
php artisan vendor:publish --tag=buffer-config
This is the contents of the published config file:
return [ 'access_token' => env('BUFFER_ACCESS_TOKEN', ''), 'base_url' => env('BUFFER_BASE_URL', 'https://api.bufferapp.com/1'), ];
Add your Buffer access token to .env. Generate one at buffer.com/developers/apps by creating an app:
BUFFER_ACCESS_TOKEN=your-access-token
Usage
All methods return the decoded JSON response as an array, or throw a JeffersonGoncalves\Buffer\Exceptions\BufferException when the Buffer API returns a failed HTTP response.
use JeffersonGoncalves\Buffer\Facades\Buffer; // or resolve the manager from the container: app(\JeffersonGoncalves\Buffer\Buffer::class)
User
// GET /user.json $user = Buffer::user()->info(); // POST /user/deauthorize.json Buffer::user()->deauthorize();
Profiles
// GET /profiles.json $profiles = Buffer::profiles()->list(); // GET /profiles/{id}.json $profile = Buffer::profiles()->get('4eb854340acb04e870000005'); // GET /profiles/{id}/schedules.json $schedules = Buffer::profiles()->schedules('4eb854340acb04e870000005');
Updates
// GET /updates/{id}.json $update = Buffer::updates()->get('4eb8ab585208912e5f000005'); // GET /profiles/{id}/updates/pending.json — page, count and since are optional $pending = Buffer::updates()->pending('4eb854340acb04e870000005', page: 1, count: 10); // GET /profiles/{id}/updates/sent.json $sent = Buffer::updates()->sent('4eb854340acb04e870000005', since: now()->subWeek()->timestamp); // POST /updates/create.json Buffer::updates()->create( profileIds: ['4eb854340acb04e870000005'], text: 'Scheduled from Laravel!', scheduledAt: '2026-01-01 12:00:00', now: false, top: false, shorten: false, ); // POST /updates/{id}/update.json Buffer::updates()->update('4eb8ab585208912e5f000005', 'Updated text', '2026-01-02 09:00:00'); // POST /updates/{id}/share.json Buffer::updates()->share('4eb8ab585208912e5f000005'); // POST /updates/{id}/destroy.json Buffer::updates()->destroy('4eb8ab585208912e5f000005'); // POST /profiles/{id}/updates/shuffle.json Buffer::updates()->shuffle('4eb854340acb04e870000005');
API Configuration
// GET /info/configuration.json $config = Buffer::info();
Handling errors
use JeffersonGoncalves\Buffer\Exceptions\BufferException; use JeffersonGoncalves\Buffer\Facades\Buffer; try { Buffer::user()->info(); } catch (BufferException $e) { // $e->getMessage() — the Buffer API error message // $e->getCode() — the HTTP status code // $e->errorBody() — the full decoded error payload }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
