Laravel 4 : image resize package

Resize image with intervention/image

intervention/image: https://packagist.org/packages/intervention/image
install: http://image.intervention.io/getting_started/installation#laravel

composer.json: "intervention/image": "2.*"

> composer update

config/app.php:

In the $providers array add the service providers for this package.

'InterventionImageImageServiceProvider'

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

'Image' => 'InterventionImageFacadesImage'

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

Basic example: http://image.intervention.io/

// open an image file
$img = Image::make('public/foo.jpg');

// now you are able to resize the instance
$img->resize(320, 240);

// and insert a watermark for example
$img->insert('public/watermark.png');

// finally we save the image as a new image
$img->save('public/bar.jpg');

 

Blogbook : PHP | Javascript | Laravel | Corcel | CodeIgniter | VueJs | ReactJs | WordPress