PHP code example of nordsoftware / lumen-image-manager

1. Go to this page and download the library: Download nordsoftware/lumen-image-manager 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/ */

    

nordsoftware / lumen-image-manager example snippets


$app->register('Nord\Lumen\Cloudinary\CloudinaryServiceProvider');

$app->register('Nord\Lumen\ImageManager\ImageManagerServiceProvider');

public function uploadImage(Request $request, FileManager $fileManager, ImageManager $imageManager)
{
    // Save the image directly to Cloudinary
    $file = $fileManager->saveFile($request->file('upload'), ['disk' => 'cloudinary']);

    return Response::json([
        'id'  => $file->getId(),
        'url' => $imageManager->getImageUrl($file, ['transformation' => 'small'])
    ]);
}
bootstrap/app.php