定制 nordsoftware/lumen-image-manager 二次开发

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

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

nordsoftware/lumen-image-manager

最新稳定版本:1.1.0

Composer 安装命令:

composer require nordsoftware/lumen-image-manager

包简介

Image manager module for the Lumen framework.

README 文档

README

Code Climate Scrutinizer Code Quality StyleCI Latest Stable Version Total Downloads License

Image manager for the Lumen PHP framework.

Please note that this module is still under active development.

Requirements

Usage

Installation

Run the following command to install the package through Composer:

composer require nordsoftware/lumen-image-manager

Bootstrapping

Please note that we only support Cloudinary for now.

Add the following lines to bootstrap/app.php:

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

You can now use the ImageManager facade or inject the Nord\Lumen\ImageManager\Contracts\ImageManager where needed.

Example

Below is an example of how to use this module to save an image from the request and return a JSON response with the saved image's ID and URLs.

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'])
    ]);
}

Contributing

Please read the guidelines.

License

See LICENSE.

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 15
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-05