catlabinteractive/central-storage-client

Client for CatLab central storage.

Maintainers

Package info

github.com/CatLabInteractive/central-storage-client

pkg:composer/catlabinteractive/central-storage-client

Transparency log

Statistics

Installs: 2 329

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.0 2026-07-09 07:25 UTC

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 SplFileInfo object 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() and delete() removed
  • sign(), isValid(), and fromConfig() methods removed; use signParameters() and isValidParameters() instead

API Changes:

  • store() now takes a file path (string) or SplFileInfo object directly, plus optional filename