PHPackages                             catlabinteractive/central-storage-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. catlabinteractive/central-storage-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

catlabinteractive/central-storage-client
========================================

Client for CatLab central storage.

v1.0.6(5y ago)02.2kMITPHP

Since Feb 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/CatLabInteractive/central-storage-client)[ Packagist](https://packagist.org/packages/catlabinteractive/central-storage-client)[ RSS](/packages/catlabinteractive-central-storage-client/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (3)Versions (12)Used By (0)

Central Storage Laravel Client
------------------------------

[](#central-storage-laravel-client)

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
-----

[](#setup)

Please follow the setup instructions described in the [central storage project page](https://github.com/catlabinteractive/central-storage) to setup to storage system. Once that has been setup, you can include this library in your project to start storing assets.

Setting up your client project (in Laravel)
-------------------------------------------

[](#setting-up-your-client-project-in-laravel)

Central Storage provides a standard REST API and is thus consumable by any language or framework. We will focus on the existing Laravel client here. Note that it is a trivial task to implement a new client, as there is only a few methods to implement.

In your Laravel project, run `composer require catlabinteractive/central-storage-client`

Then, wherever you want to upload a file, initialize the client:

```
$centralStorageClient = new CentralStorageClient(
    'https://your-central-storage-url.com',
    'your_key',
    'your_secret',
    'cdn_frontend_url' // (optional)
);
```

Or, if you like, you can use the provider that uses the default configuration files:

```
    'providers' => [

        [...]

        CatLab\CentralStorage\Client\CentralStorageServiceProvider::class,

    ],

    'aliases' => [

        [...]

        'CentralStorage' => CatLab\CentralStorage\Client\CentralStorageClientFacade::class,

    ]
]
```

The PHP client consumes Symfony's File objects. That means you can upload files straight from Laravel. The client returns an Eloquent model 'Asset', which can be saved directly to a database (migration file is available in `central-storage-client/database`).

```
