title: Lumen API + Laravel guzzlehttp response 500 Internal Server Error
body: <p>I am working on a Lumen + Laravel application wherein Lumen is my RESTful API while my Laravel is the web app itself.</p>
  
  <p>Laravel 5.2.0</p>
  
  <p>Lumen 5.1.6</p>
  
  <p>I have installed guzzlehttp on my Laravel web app for API requests (get, post, delete, put). Whenever I do a GET request, I get a <code>Server error: 'GET http://example.local/api/blog' resulted in a '500 Internal Server Error' response:</code> when retrieving from my Lumen API. But when I do a request thru PostMan, I am able to retrieve data successfully even when I input <code>http://example.local/api/blog</code> directly on the browser, I get the json response.</p>
  
  <p>Lumen GET:</p>
  
  <pre><code>public function getBlogs()
  {
      return response()-&gt;json($this-&gt;sqlConnection()-&gt;table(self::TABLE_NAME)-&gt;get(), 200);
  }
  </code></pre>
  
  <p>Laravel:</p>
  
  <pre><code>public function index(Client $client)
  {
      return $client-&gt;get('http://example.local/api/blog')-&gt;getBody();
  }
  </code></pre>
  
  <p>I do have other RESTful APIs build with a different framework and tried to test it out if my Laravel web app could connect and it was able to. I find it weird because connecting thru my Lumen API always return a 500 internal server error.</p>