System Requirements
- PHP >= 5.3
- Fileinfo Extension
- GD Library (>=2.0) ... or ...
- Imagick PHP Extension (>=6.5.7)
Install Deployment Integration/image
Add in Composer.json [require] section, then perform composer update
" Intervention/image " " 2.0.15 "
Laravel Configuration
After the installation deployment Integration/image is complete, open the configuration file config/app.php add the code in the appropriate location, and the image class will be automatically loaded and ready for use. It's powerful to handle almost all your picture processing needs.
// Service Provider ' Intervention\image\imageserviceprovider ' // alias Configuration ' Image ' ' Intervention\image\facades\image '
Configuration settings
By default, Integration/image uses the PHP GD library extension. If you want to switch to Imagick, you can use PHP artisan to create a configuration file to add the appropriate configuration.
$ php Artisan config:publish Intervention/imag
Basic use
A few basic features are listed here, and more detailed instructions are available in the relevant interface documentation.
1. Display a picture
function () { $img = Image::make (' foo.jpg ')->resize (+); return $img->response (' jpg ');});
2. read a picture file
$img = Image::make (' foo/bar/baz.jpg ');
3. Draw a picture
$img = Image::canvas (+, ' #ccc ');
4. Edit a picture
$img = Image::make (' foo.jpg ')->insert (' Watermark.png ')->resize ("the");
Use the picture processing library in Laravel Integration/image