Installation

  • PHP >= 5.4
  • Fileinfo Extension

And one of the following image libraries.

  • GD Library (>=2.0) … or
  • Imagick PHP extension (>=6.5.7)

The best way to install Intervention Image is quickly and easily with Composer.

To install the most recent version, run the following command.

Now your has been updated automatically and you’re able to require the just created vendor/autoload.php file to PSR-4 autoload the library.


Intervention Image doesn’t require Laravel or any other framework at all. If you want to use it as is, you just have to require the composer autoload file to instatiate image objects as shown in the following example.

Example

You might also use the static version of ImageManager as shown in the example below.

Static Example


Intervention Image has optional support for and comes with a Service Provider and Facades for easy integration. The is included by Laravel, so you don’t have to require or autoload manually. Just see the instructions below.

After you have installed Intervention Image, open your Laravel config file config/app.php and add the following lines.

In the array add the service providers for this package.

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

Now the Image Class will be auto-loaded by Laravel.

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 one of the following artisan command.

Publish configuration in Laravel

Publish configuration in Laravel <= 4

In recent Laravel applications the configuration file is copied to , in older Laravel 4 applications you will find the file at app/config/packages/intervention/image/config.php. With this copy you can alter the image driver settings for you application locally.

Example