dam-bal / vercel-blob-php
PHP Client for Vercel Blob
Installs: 243
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/dam-bal/vercel-blob-php
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.8
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-09-21 22:35:44 UTC
README
PHP Client for Vercel Blob Storage.
Install
composer require dam-bal/vercel-blob-php
Usage
Creating Client
$client = new \VercelBlobPhp\Client();
Client constructor accepts token for blob storage, but if you connected your blob storage to project then you don't need to set it.
Using Client
PUT
$result = $client->put( path: 'test.txt', // path content: 'hello world' // content, options: new \VercelBlobPhp\CommonCreateBlobOptions( addRandomSuffix: true, // optional contentType: 'text', // optional cacheControlMaxAge: 123, // optional ) );
Options argument is optional.
DEL
$client->del(['test.txt']);
COPY
$result = $client->copy( fromUrl: 'fromUrl', toPathname: 'toPathname', options: new \VercelBlobPhp\CommonCreateBlobOptions( addRandomSuffix: true, // optional contentType: 'text', // optional cacheControlMaxAge: 123, // optional ) );
HEAD
$result = $client->head('url');
LIST
$result = $client->list( options: new \VercelBlobPhp\ListCommandOptions( limit: 100, // optional cursor: 'cursor', // optional mode: \VercelBlobPhp\ListCommandMode::EXPANDED, // optional prefix: 'prefix', // optional ) );
Options argument is optional.