title: Returning JSON array rom database response (lumen php)
body: <p>i am trying to sort the response i recive from my database to return a nice JSON array but i cant find how to do it and so i turn to you for help.</p>
  
  <p>The response from the database:</p>
  
  <pre><code>[{"stad":"\u00d6rebro","lokalnamn":"Allm\u00e4nrepan"}, 
  {"stad":"Kumla","lokalnamn":"Rum 1"},{"stad":"Kumla","lokalnamn":"Rum 
  2"}, 
  {"stad":"Kumla","lokalnamn":"Rum 4"}, 
  {"stad":"Karlstad","lokalnamn":"UNO"}, 
  {"stad":"Karlstad","lokalnamn":"Replokal 231"}]
  </code></pre>
  
  <p>i would like it to return something like:</p>
  
  <pre><code>[
  "\u00d6rebro":{"Allm\u00e4nrepan"},
  "kumla":{"Rum 1","Rum 2","rum 4"},
  "Karlstad":{"uno","replokal 231"}
  ]
  </code></pre>
  
  <p>hope you get the point, </p>
  
  <p>have tried to call response->json() on array, without success and i cant find any further information online as im not sure what to search for</p>