承接 maximumadvertising/laravel-image-resize 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

maximumadvertising/laravel-image-resize

最新稳定版本:1.1.1

Composer 安装命令:

composer require maximumadvertising/laravel-image-resize

包简介

Dynamically resize an image and returns the URL using Intervention and Storage

README 文档

README

Dynamically resize an image and returns the URL using Intervention and Storage

Latest Stable Version Latest Unstable Version

Require

  • Laravel 5 or 6
  • Intervention Image ^2.4

Supported Filesystem Drivers

  • Local
  • S3
  • Oss (Aliyun Cloud Storage)

Installation

This package can be installed through Composer.

composer require maximumadvertising/laravel-image-resize

For Laravel 5.4 and lower, you'll have to register the service provider and alias manually.

Add to service providers

Mxmm\ImageResize\ImageResizeServiceProvider::class,

And alias

'ImageResize' => Mxmm\ImageResize\Facade::class,	

Publish config and assets (Optional)

php artisan vendor:publish --provider="Mxmm\ImageResize\ImageResizeServiceProvider"

Usage

Accepted parameters:

/**
 * @param string|null $path
 * @param int|null $width
 * @param int|null $height
 * @param string $action
 * @return string
 */
public static function url(string $path = null, int $width = null, int $height = null, string $action = 'fit'): string

In HTML:

<img src="{{ ImageResize::url('originalDir/filename.jpg', width, height, [action]) }}" />

Fit (resize & crop) an image to 200x200px

<img src="{{ ImageResize::url('originalDir/filename.jpg', 200, 200, 'fit') }}" />

Resize an image to 200x200px

<img src="{{ ImageResize::url('originalDir/filename.jpg', 200, 200, 'resize') }}" />

Fit (resize & crop) an image to 200px width, with auto height

<img src="{{ ImageResize::url('originalDir/filename.jpg', 200, null, 'fit') }}" />

sample output

<img src="https://localhost/thumbs/originalDir/fit/200x200/filename.jpg" />

Tests

Run tests with:

vendor/bin/phpunit

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固