ReflectionException in Container.php Image class does not exist for intervention

I tried to save the image that comes from the POST request using laravel. but it gives me the following error.

  ReflectionException on line Container.php 741: class image does not exist

I did the following things: including the fileinfo extension in the php.ini file and composer dumpautoload but it fails, I followed the directions here I use Laravel 5.1

my code is the same

public function saveImage(){

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

}
+5
source share
1 answer

Did you include the class at the beginning of the document?

use Intervention\Image\ImageManagerStatic as Image;
+17
source

Source: https://habr.com/ru/post/1627569/


All Articles