We often need to manipulate Images for various purpose such as creating thumbnails or just simple resizing to fit proper size, it is quite cumbersome to perform these tasks in PHP, but intervention package make it so easy, we are going to use Intervention/image package to perform these tasks, intervention package has great documentation, you can crop, resize, grayscale, circle image and do tons of other stuff with ease, let's check it out.

What we are going to build

We are going to build image resize app, it will have a simple form which will contain file input and drop-down to select image size, on the submission of this form, we will resize the image.

Toggle Imagedevartisans - laravel image resize

Installing Dependencies

We need intervention package, for easy form creation we are going to get HTML package as well which is separately available from core Laravel.

Let's open composer.JSON file which exists in the root of your project, add intervention/image and illuminate/html dependencies to require object.