catlabinteractive / central-storage-client
Client for CatLab central storage.
Package info
github.com/CatLabInteractive/central-storage-client
pkg:composer/catlabinteractive/central-storage-client
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^6.3|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.6
This package is auto-updated.
Last update: 2026-07-09 07:25:41 UTC
README
Central Storage is a storage engine built in Laravel. It includes duplicate upload detection, supports on the fly image (but cached) image resize and allows you to set 'Processors' that handle more complex file transformations like video transcoding etc.
Setup
Please follow the setup instructions described in the central storage project page to setup to storage system. Once that has been setup, you can include this library in your project to start storing assets.
Installation
Central Storage provides a standard REST API and is consumable by any language or framework.
Install via composer:
composer require catlabinteractive/central-storage-client
Usage
Initialize the client with your Central Storage server URL and credentials:
$client = new \CatLab\CentralStorage\Client\CentralStorageClient( 'https://storage.example.com', $consumerKey, $consumerSecret ); // Store a local file $asset = $client->store('/tmp/upload-tmpfile', 'photo.jpg', [ 'publisher' => 1 ]); echo $client->getAssetUrl($asset); // Remove it again $client->delete($asset);
The store() method accepts:
- A file path (string) or
SplFileInfoobject as the first argument - An optional filename (defaults to the original filename)
- Optional attributes array (e.g., metadata like publisher)
- Optional server, key, and secret overrides
Version 2.0 Breaking Changes
Requirements: PHP >= 8.1
Removed features:
- Laravel ServiceProvider, Facade, and Eloquent Asset integration removed (stay on v1.x for Laravel projects)
- Database migration for Asset model no longer provided
- Eloquent Asset instance methods
getUrl()anddelete()removed sign(),isValid(), andfromConfig()methods removed; usesignParameters()andisValidParameters()instead
API Changes:
store()now takes a file path (string) orSplFileInfoobject directly, plus optional filename