PHPackages                             taffovelikoff/imagekit-adapter - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. taffovelikoff/imagekit-adapter

ActiveLibrary[File &amp; Storage](/categories/file-storage)

taffovelikoff/imagekit-adapter
==============================

Flysystem adapter for ImageKit.

2.0.0(3y ago)1421.0k↓16.1%1[2 issues](https://github.com/TaffoVelikoff/imagekit-adapter/issues)MITPHPPHP ^8.0

Since Sep 14Pushed 3y ago2 watchersCompare

[ Source](https://github.com/TaffoVelikoff/imagekit-adapter)[ Packagist](https://packagist.org/packages/taffovelikoff/imagekit-adapter)[ RSS](/packages/taffovelikoff-imagekit-adapter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Flysystem adapter for the ImageKit API
======================================

[](#flysystem-adapter-for-the-imagekit-api)

A [Flysystem](https://flysystem.thephpleague.com/) adapter for [ImageKit](https://imagekit.io/). This package used to be Laravel only, but it can now be used in any php project! If you are using an older version of this package in a Laravel app, please read the "Usage in Laravel" section.

Contents
--------

[](#contents)

[⚙️ Installation](#installation)

[🛠️ Setup](#setup)

[👩‍💻 Usage](#usage)

[🚀 Usage in Laravel](#usage-in-laravel)

[👊 Contributing](#contributing)

[📄 License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require taffovelikoff/imagekit-adapter
```

Setup
-----

[](#setup)

First you will need to sing up for an [ImageKit](https://imagekit.io/) account. Then you can go to  to get your public key, private key and url endpoint.

Usage
-----

[](#usage)

```
use ImageKit\ImageKit;
use League\Flysystem\Filesystem;
use TaffoVelikoff\ImageKitAdapter\ImageKitAdapter;

// Client
$client = new ImageKit (
    'your_public_key',
    'your_private_key',
    'your_endpoint_url' // Should look something like this https://ik.imagekit.io/qvkc...
);

// Adapter
$adapter = new ImagekitAdapter($client);

// Filesystem
$fsys = new Filesystem($adapter);

// Check if file exists example
$file = $fsys->fileExists('default-image.jpg');
```

If you need to purge the cache after a file was updated/deleted you can add "purge\_cache" to the $options array of the adapter.

```
$adapter = new ImagekitAdapter($client, $options = [
    'purge_cache_update'    => [
        'enabled'       => true,
        'endpoint_url'  => 'your_endpoint_url'
    ]
]);
```

This will create a purge cache request. You can read more here:

Usage in Laravel
----------------

[](#usage-in-laravel)

You can create a new driver by extending the Storage in the `boot()` method of `AppServiceProvider`.

```
public function boot()
{
    Storage::extend('imagekit', function ($app, $config) {
        $adapter = new ImagekitAdapter(

            new ImageKit(
                $config['public_key'],
                $config['private_key'],
                $config['endpoint_url']
            ),

            $options = [ // Optional
                'purge_cache_update'    => [
                    'enabled'       => true,
                    'endpoint_url'  => 'your_endpoint_url'
                 ]
            ]

        );

        return new FilesystemAdapter(
            new Filesystem($adapter, $config),
            $adapter,
            $config
        );
    });
}
```

Then create a new disk in `config/filesystems.php`:

```
'imagekit' => [
    'driver' => 'imagekit',
    'public_key' => env('IMAGEKIT_PUBLIC_KEY'),
    'private_key' => env('IMAGEKIT_PRIVATE_KEY'),
    'endpoint_url' => env('IMAGEKIT_ENDPOINT_URL')
],
```

Don't forget to add your keys in `.env`:

```
IMAGEKIT_PUBLIC_KEY = your-public-key
IMAGEKIT_PRIVATE_KEY = your-private-key
IMAGEKIT_ENDPOINT_URL = your-endpint-url
```

And now you can use Laravel's Storage facade:

```
Storage::disk('imagekit')->put('test.txt', 'This is a test file.');

return response(Storage::disk('imagekit')->get('test.txt'));
```

If you already use an older version of `taffovelikoff/imagekit-adapter` in your Laravel app you most likely published the configuration file `config/imagekit.php`. It was possible to set a few options there:

```
return [
    'purge_cache_update'    => true,
    'extend_storage'        => true,
];
```

The `extend_storage => true` setting automatically expanded the Storage facade and created 'imagekit' driver. If you were using that option you need to manually add the new driver in `AppServiceProvider` like the example above.

If the `purge_cache_update` setting was set to `true` a cache purge request was made when deleting/updating a file. In order tо keep this functionality all you need to do now is add `purge_cache_update` parameter in the options of the ImageKitAdapter when extending the storage.

Contributing
------------

[](#contributing)

Pull requests are welcome. Please feel free to lodge any issues or feedback as discussion points.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~323 days

Total

3

Last Release

1425d ago

Major Versions

1.0.2 → 2.0.02022-06-23

PHP version history (2 changes)1.0.1PHP &gt;=7.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/86d23287dea7486112423331540e81c17c9b7fb3f79c43c7410505af4961572c?d=identicon)[TaffoVelikoff](/maintainers/TaffoVelikoff)

---

Top Contributors

[![TaffoVelikoff](https://avatars.githubusercontent.com/u/20744689?v=4)](https://github.com/TaffoVelikoff "TaffoVelikoff (12 commits)")[![dircm](https://avatars.githubusercontent.com/u/18188561?v=4)](https://github.com/dircm "dircm (2 commits)")

---

Tags

flysystemimagekitlaravelapiFlysystemadapterhostcdnimagekittavvotaffovelikofftaffo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/taffovelikoff-imagekit-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/taffovelikoff-imagekit-adapter/health.svg)](https://phpackages.com/packages/taffovelikoff-imagekit-adapter)
```

###  Alternatives

[mhetreramesh/flysystem-backblaze

Backblaze adapter for the flysystem filesystem abstraction library

62146.8k9](/packages/mhetreramesh-flysystem-backblaze)[justus/flysystem-onedrive

A flysystem driver for OneDrive that uses the Microsoft Graph API

48104.4k](/packages/justus-flysystem-onedrive)[jacekbarecki/flysystem-onedrive

OneDrive adapter for the flysystem filesystem abstraction library

2429.9k](/packages/jacekbarecki-flysystem-onedrive)[royvoetman/flysystem-gitlab-storage

Flysystem Adapter for the Gitlab Repository files API v4

1123.3k4](/packages/royvoetman-flysystem-gitlab-storage)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
