定制 youssefreda4/cloudinary-manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

youssefreda4/cloudinary-manager

最新稳定版本:v1.0.1

Composer 安装命令:

composer require youssefreda4/cloudinary-manager

包简介

Professional Laravel Cloudinary integration package

README 文档

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

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-20