2017-09-13 9 views
0

私は検索してこの問題の答えを見つけられませんでした。Intervention画像ソースが更新時に読み込めない

まあ、私は写真をアップロードするために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を取得します。 これは、再アップロードのためのコードです:私は両方の形式でenctype="multipart/form-data"を使用

 $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; 

、のための作成および更新。 更新フォームiでも{{method_field('PUT'}}を使用してください。

ここには何が欠けていますか?ありがとう。

+0

どのバージョンのPHPをお使いですか? –

+0

私はPHPを使用しています7 @sunitiyadav – GabMic

答えて

0

私はこの問題を解決しました。 "それはいつも小さなものです"と彼らは言う。 ロゴイメージを挿入したとき、私は存在しないphtotoを参照しました。それは明らかに私にエラーを与えた理由です。

関連する問題