Laravel 图片裁剪

装包

composer require intervention/image

修改 app/config/app.php
1. ServiceProvider

Intervention\Image\ImageServiceProvider::class,
  1. aliases
'Image' => Intervention\Image\Facades\Image::class,

配置文件

php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

使用:

Image::make($file_path)->fit(180, 120)->save($file_path, 80);

28 total views, 6 views today

Revisions

No comments yet.

发表评论