Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReflectionException in Container.php Class image does not exist for intervention

I tried to save an image which comes form POST request using laravel. but it gives me the following error.

ReflectionException in Container.php line 741: Class image does not exist

I did the following things : enabling the fileinfo extension in php.ini file and composer dumpautoload but nothing is work I followed the guide line here I am using laravel 5.1

my code is as bellow

public function saveImage(){

    Image::make(Input::file('files')->getRealPath())
        ->resize(870, null, true, false)
        ->save('foo.jpg');

}
like image 606
roledene JKS Avatar asked Feb 06 '16 13:02

roledene JKS


1 Answers

Did you include the class, in the top of the document?

use Intervention\Image\ImageManagerStatic as Image;
like image 152
René Juul Askjær Avatar answered Sep 30 '22 08:09

René Juul Askjær