title: How to display image in laravel after return image from guzzle API
body: <p>Hi I want to display private image in my project by sending API with jwt token. I use postman to test. Postman return an image but How can I display image like post man.</p>
  
  <p>Here Is my code  Controller sendApi</p>
  
  <pre><code>public function getIdCard($name) {
          $token = $this-&gt;getToken();
          $client = new Client(['base_uri' =&gt; env('URL_FRONTEND')]);
          $headers = [
              'Authorization' =&gt; 'Bearer ' . $token,
          ];
          $response = $client-&gt;request('GET', 'storage/getIdCard/icQE5nwU1jQl1lrIZJmGxVs2GDIIsDjbuQo541VlwzhNTl7iEe1555385649.png', [
              'headers' =&gt; $headers
          ]);
  
          $response = $response-&gt;getBody()-&gt;getContents();
          return $response;
      }
  </code></pre>
  
  <p>Here is my API/ Controller [ from another project]</p>
  
  <pre><code> public function getIdCard($file_name){;
          $storagePath = storage_path('app/id_card/'. $file_name);
          return Image::make($storagePath)-&gt;response();
    }
  </code></pre>
  
  <p>Here is what I get</p>
  
  <pre><code>PNG  IHDR��B5   pHYs���+ IDATx��yx�U�?��Nw�@B�o�Ha"ʦ� ����(.����� ��l^t��늨�D�EYe5Q�d5l��,$d�������'U眷�~��ɓ~�R���T�yC���t� ��b���`�$���z�Á�� -&gt;W� ]�+��*������L�����"y��Hn��yj��H�Ma�ɗ�"��x��ǹϺxt�7�8���H��M�_0�ҿs�/&lt;��o�X����h*,��,5e�Ή��1{�e��pS�,�M����z��)�R8fd5����\����SƗ�r�:J�j�ǸO�UfK�d�U��vR:��ƛ7*��v2�������dS�T礱����=c/j��\�kus��:������,�DE�Z��E���R)Y�AT�׈��!~��(�s�m@ͻ��M:"&amp;n�����d���/�8��]�1�d���[� +5�s.tyǩ)��lF��ĬJ���us����[c�F:�U����%����/���*]���B�'Q��2]:X�݋�����q���R_�5N���"n�j� �[����}W}��#�7��{Va?��íQ���]5�����_J���¤��6NG�-͜5n?#�8Ug�z��esoT��]+����!]�E]�x����D=[�N�K���8��*5�3Ήrd�p�ps:�#%��O��-�\E^:gNg^��rq��O��iPT�\q�(�_�3{84�����kWH�o��Zw��/�Y�+��r��
  </code></pre>
  
  <p>In Postman It's return Image How can I display in like postman</p>
  
  <p><strong>UPDATE</strong> 
  I add function in Api/controller still not working</p>
  
  <pre><code>public function getIdCard($file_name){;
          $storagePath = storage_path('app/id_card/'. $file_name);
          $headers = [
              "Content-type: image/png",
          ];
          return response()-&gt;file($storagePath, $headers);
     }
  </code></pre>
  
  <p>**UPDATE 2 **</p>
  
  <p>I'm working on 2 project 
  - The first project I return API return response()->file($storagePath, $headers);
  -Then I use post man and it's return image
  - The second project I want to get image from API  and I use</p>
  
  <pre><code>   $response = $response-&gt;getBody()-&gt;getContents();
  </code></pre>
  
  <p>It's return text/html  How to display it into image</p>