且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Laravel 4干预\ Image \ Exception \ ImageNotWritableException

更新时间:2023-11-17 12:00:22

确保 public / img / products 文件夹存在并且它是可写的,并且如果需要也尝试使用绝对路径,如下所示:

Make sure the public/img/products folder exists and it's writable and also try to use absolute path if necessary, like this:

$filename  = time() . '.' . $image->getClientOriginalExtension();
$path = public_path('img/products/' . $filename);
Image::make($image->getRealPath())->resize(468, 249)->save($path);