0
我已经搜索过,并且未找到对此问题的答案。干预图像源在更新上不可读
那么,我正在使用干预与laravel 5.5上传照片。 当我create
一个新的食谱(在我的情况),所有工作和照片成功上传。
这是最初的上传代码:
$front_image = $request->file('front_image');
$frontImageName = md5(time()) . '.' . $front_image
->getClientOriginalExtension();
$locationfi = public_path('photos/front/' . $frontImageName);
Image::make($front_image)
->resize(454,340)
->insert(public_path('photos/logo.png'),'bottom-right')
->save($locationfi);
$recipe->front = $frontImageName;
所有标准的东西。 但是,当我尝试edit
的配方,我得到Image source not readable
。 这是重新上传代码:
$front_image = $request->file('front_image');
$frontImageName = md5(time()).'.'.$front_image
->getClientOriginalExtension();
$location = public_path('photos/front/'.$frontImageName);
Image::make($front_image)->resize(690,517)
->insert(public_path('photos/tk.png'),'bottom-right')
->save($location);
//update the database
$recipe->front=$imageName;
我用enctype="multipart/form-data"
两种形式,为创建和更新。 在更新表单上我也使用{{method_field('PUT'}}
。
我在这里失踪了什么?谢谢。
你正在使用哪个版本的php? –
我使用的是PHP 7. @sunitiyadav – GabMic