title: How do you convert Laravel query results to json?
body: <p>I have a query that I call with:</p>
  
  <pre><code>$query = "select * from myTable";
  $results = DB::connection('myDB')-&gt;select($query);
  </code></pre>
  
  <p>I want to be able to get this in the simple json format of:</p>
  
  <pre><code>[{firstColumn: firstColumnValue, secondColumn: secondColumnValue},
  {firstColumn: firstColumnValue, secondColumn: secondColumnValue}]
  </code></pre>
  
  <p>What is the easiest way to achieve this?</p>