1. Go to this page and download the library: Download junaidiar/imagekit-adapter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
junaidiar / imagekit-adapter example snippets
use ImageKit\ImageKit;
use League\Flysystem\Filesystem;
use JunaidiAR\ImageKitAdapter\ImageKitAdapter;
// Setup Client
$client = new ImageKit (
'your_public_key',
'your_private_key',
'your_endpoint_url'
);
// Adapter
$adapter = new ImagekitAdapter($client);
// Filesystem
$fsys = new Filesystem($adapter);
// Check if file exists example
$file = $fsys->fileExists('default-image.jpg');
public function boot()
{
Storage::extend('imagekit', function ($app, $config) {
$adapter = new ImagekitAdapter(
new ImageKit(
$config['key'],
$config['secret'],
$config['endpoint_url']
),
);
return new FilesystemAdapter(
new Filesystem($adapter, $config),
$adapter,
$config
);
});
}