Container.php类图像中的ReflectionException不存在,无法进行干预

问题描述 投票:5回答:1

我试图使用laravel保存来自POST请求的图像。但这给了我以下错误。

Container.php第741行中的ReflectionException:类图像不存在

我做了以下事情:在php.ini文件中启用fileinfo扩展名和composer dumpautoload但没有任何工作,我遵循了准则here我正在使用laravel 5.1

我的代码如下所示

public function saveImage(){

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

}
php image laravel laravel-5.1 intervention
1个回答
17
投票

您是否在文档顶部添加了课程?

use Intervention\Image\ImageManagerStatic as Image;
© www.soinside.com 2019 - 2024. All rights reserved.