youssefreda4/cloudinary-manager

Professional Laravel Cloudinary integration package

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/youssefreda4/cloudinary-manager

v1.0.1 2025-11-20 19:21 UTC

This package is auto-updated.

Last update: 2025-11-20 20:04:22 UTC


README

A professional Laravel package for managing media uploads with Cloudinary.

Installation

composer require youssefreda4/cloudinary-manager

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=cloudinary-config

Add to your .env:

CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

Usage

Using Facade

use CloudinaryManager\Facades\Cloudinary;

// Upload image
$result = Cloudinary::uploadImage($request->file('image'), 'products');

// Delete image
Cloudinary::deleteImage('products/image_id');

// Generate URL with transformations
$url = Cloudinary::generateUrl('products/image_id', [
    'width' => 300,
    'height' => 300,
    'crop' => 'fill'
]);

Using Trait in Models

use CloudinaryManager\Traits\HasCloudinaryMedia;

class Product extends Model
{
    use HasCloudinaryMedia;

    public function uploadProductImage($file)
    {
        $result = $this->uploadToCloudinary($file, 'image', 'products');
        $this->image_public_id = $result->publicId;
        $this->image_url = $result->secureUrl;
        $this->save();
    }
}

API Endpoints

The package automatically registers these routes:

  • POST /api/cloudinary/upload/image
  • POST /api/cloudinary/upload/video
  • DELETE /api/cloudinary/delete/image
  • DELETE /api/cloudinary/delete/video
  • GET /api/cloudinary/resource/info

License

MIT