title: How could I cache images using Laravel
body: <p>I would like to cache images in Laravel. All the solution I could find where for images I am serving myself but the images are coming from a google places api call. From the place details api call. </p>
  
  <p>So what I would like to do if a user requests the images for a certain location that using my webapp, I would like to cache the images that are retrieved as a result.</p>
  
  <p>The google places details api call retrieves the hash for the image and I can construct the url for the image like this:</p>
  
  <pre><code>$photos[] = 'https://maps.googleapis.com/maps/api/place/photo?photoreference=' . 
               $photo-&gt;photo_reference . 
              '&amp;sensor=false&amp;maxheight=400&amp;maxwidth=400&amp;key=' . 
               $apiKey;
  </code></pre>
  
  <p>The image is then retrieved and shown in the front end. </p>
  
  <p>We are using the Laravel way by doing something like <code>Cache::get($id.'photos')</code> but this only caches the url and that isn't very helpful.</p>
  
  <p>We also found the following link <a href="https://github.com/Intervention/imagecache" rel="nofollow noreferrer">https://github.com/Intervention/imagecache</a> but this repo is quite old and we are using Laravel 5.7 so the techniques employed in this repo are no longer applicable.</p>
  
  <p>Any suggestions would be greatly apreciated!</p>