user3458952 user3458952 - 10 months ago 185
PHP Question

Intervention Image Laravel 5.1

I tried to resize img, I do this step:
update composer:

"intervention/image": "dev-master",

next add lines in app/config

'Image' => Intervention\Image\Facades\Image::class

In my controller:

use Intervention\Image\Image as Img;
Img::make($destination_path . $filename)->resize(200, 200)->save($destination_path . $filename);

and this is error:

Call to undefined method Intervention\Image\Image::make()

All In laravel 5.1



1) check if you have model in your App (by default) folder named as Image


a) put use Image; to the top of your controller

b) throw this away: use Intervention\Image\Image as Img;

c) just use this: Image::make( not Img:make(