title: Getting the JSON reponse from an API with Laravel
body: <p>I am just messing with APIs and now I'm trying to use <a href="https://developers.google.com/maps/documentation/directions/?csw=1" rel="nofollow">Google Directions API</a> in my app.</p>
  
  <p>I made a form to get the user's input and retrieve this data and create the URI just in the <code>routes.php</code> file:</p>
  
  <pre><code>Route::get('/directions', function() {
      $origin = Input::get('origin');
      $destination = Input::get('destination');
  
      $url = "http://maps.googleapis.com/maps/api/directions/json?origin=" . $origin . "&amp;destination=" . $destination . "&amp;sensor=false";
  });
  </code></pre>
  
  <p>That URL's response is a JSON. But now, how am I supposed to store that response with Laravel? I have been looking at the Http namespace in Laravel and I didn't find a way. If it can't be done with Laravel, how can it be done with plain php?</p>