我尝试使用 laravel 保存来自 POST 请求的图像。但它给了我以下错误。
ReflectionException in Container.php line 741: Class image does not exist
我做了以下事情:
在 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');
}
最佳答案
您是否在文档顶部包含了该类?
use Intervention\Image\ImageManagerStatic as Image;
关于php - Container.php类镜像不存在的ReflectionException进行干预,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35241761/