定制 soumen-dey/laravel-image 二次开发

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

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

soumen-dey/laravel-image

Composer 安装命令:

composer require soumen-dey/laravel-image

包简介

A package to encode and generate thumbnail for Laravel 5.6 and above.

README 文档

README

Latest Version on Packagist Total Downloads

A package to encode and store your Uploaded Images for Laravel 5.6 and above.

Installation

Via Composer

This package depends on intervention/image

$ composer require soumen-dey/laravel-image

Laravel Auto-Discovery will automatically detect and add the Service Provider and Alias for the package. If it doesn't, do the following:

In the $providers array add the service providers for this package.

Soumen\Image\ImageServiceProvider::class

Add the facade of this package to the $aliases array.

'Image' => Soumen\Image\Facades\Image::class

Configuration

By default this packages uses GD library for processing the images, to change this behaviour and also to modify the default storage options, publish the configuration file for this package.

$ php artisan vendor:publish --provider="Soumen\Image\ImageServiceProvider"

Usage

use Soumen\Image

$file = $request->file('file');

// This will initialize and extract meta-data from the image
$image = new Image($file);

// This will encode the image and generate thumbnail
$image->process();

// Store the image in the storage
$image->store();

You can also use method chaining to write the above code in one line.

$image = (new Image($file))->process()->store();

You can also specify parameters.

$image = new Image($file);
$image->setQuality(90); // the jpeg image quality, default is 50
$image->setEncoding('png'); // default is jpeg
$image->setStorage('images'); // set the storage
$image->generateThumbnail(); // generates the thumbnail
$image->encode();
$image->store();

Do not use $image->process() if you wish specify parameters.

You can also use method chaining on the above code.

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固