user3458952 user3458952 - 4 months ago 84
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

Intervention\Image\ImageServiceProvider::class,
'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

Answer

Try:

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

2)

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(