PHP code example of jeffersongoncalves / laravel-buffer

1. Go to this page and download the library: Download jeffersongoncalves/laravel-buffer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffersongoncalves / laravel-buffer example snippets


return [
    'access_token' => env('BUFFER_ACCESS_TOKEN', ''),
    'base_url' => env('BUFFER_BASE_URL', 'https://api.bufferapp.com/1'),
];

use JeffersonGoncalves\Buffer\Facades\Buffer;
// or resolve the manager from the container: app(\JeffersonGoncalves\Buffer\Buffer::class)

// GET /user.json
$user = Buffer::user()->info();

// POST /user/deauthorize.json
Buffer::user()->deauthorize();

// 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');

// 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');

// GET /info/configuration.json
$config = Buffer::info();

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
}
bash
php artisan vendor:publish --tag=buffer-config