2016-09-04 2 views

答えて

0

あなたは適切な 'コンテンツタイプ' を送信する必要があります。ここ

<img src="{{ route('account.image', ['filename' => $user->name . '-' . $user->id . '.jpg']) }}" alt="" class="img-responsive"> 

は私の経路コード

である私の見解でのimg SRCコントローラここ

`public function getUserImage($filename) 
{ 
    $file = Storage::disk('public')->get($filename); 
    return new Response($file, 200); 
}` 

されますイメージを送信する場合の応答のヘッダー。コードは次のようになります。

public function getUserImage($filename) 
{ 
    $response = Response::make(Storage::disk('public')->get($filename)); 
    $response->header('Content-Type', 'image/png'); 
    return response; 
} 
関連する問題