Laravel Lumen duplicate results by column numbers
<p>I'm using Lumen to make a simple API. I have the following action in my controller:</p>

<pre><code>public function index()
{
  $beds = Bed::all();
  return response()-&gt;json($beds);
}
</code></pre>

<p>This is the json result:</p>

<pre><code>[
  {
    "0": 2,
    "1": 2000001,
    "2": 3,
    "3": "2016-02-02 21:43:58",
    "4": "2016-02-02 21:43:58",
    "id": 2,
    "bed_id": 2000001,
    "status_id": 3,
    "created_at": "2016-02-02 21:43:58",
    "updated_at": "2016-02-02 21:43:58"
  },
  {
    "0": 3,
    "1": 2000002,
    "2": 4,
    "3": "2016-02-02 21:43:58",
    "4": "2016-02-02 21:43:58",
    "id": 3,
    "bed_id": 2000002,
    "status_id": 4,
    "created_at": "2016-02-02 21:43:58",
    "updated_at": "2016-02-02 21:43:58"
  }
]
</code></pre>

<p>I have no idea why the results are duplicates. Does anyone have?</p>

<p>UPDATE:</p>

<p>This problem occurs when I use two database connections. I created a config directory in my project and add the file config/database.php with two connections. When I remove this file, that works fine.</p>