首页 > 教程 >

Laravel使用intervention image包上传、剪裁图片

2023-02-17教程围观

简介下面给大家介绍Laravel使用interventionimage包上传、剪裁图片的方法,希望对需要的朋友有所帮助!1、通过composer安装composerintervention/image2、修改config/app.php文件,添加$providers和$aliases'InterventionImageImageServiceProvider''Image'=>'Interventio

  

下面给大家介绍 Laravel 使用 intervention image 包 上传剪裁图片的方法,希望对需要的朋友有所帮助!


Laravel使用intervention image包上传、剪裁图片


1、通过 composer 安装 composer intervention/image

2、修改 config/app.php 文件,添加 $providers 和 $aliases

'InterventionImageImageServiceProvider'

'Image' => 'InterventionImageFacadesImage'

1、By default Intervention Image uses PHP's GD library extension to process all images. If you want to switch to Imagick, you can pull a configuration file into your application by running on of the following artisan command.

Publish configuration in Laravel 5

$ php artisan vendor:publish --provider="InterventionImageImageServiceProviderLaravel5"

Handling image uploads in Laravel

In a Laravel application it is also possible to pass an uploaded file directly to the make method.

Creating Image from File Upload in Laravel

// resizing an uploaded fileImage::make(Input::file('photo'))->resize(300, 200)->save('foo.jpg')



下载链接:网站源码/小程序源码/网站模板下载

Tags: 使用 上传 Laravel intervention image