title: Laravel, converting data from raw query to JSON
body: <p>Hy all, can anyone help me with converting some data which will be return from model(based on the RAW query) into JSON.</p>
  
  <p>So in my controller i have something like:</p>
  
  <pre><code>public function get_index() {
      $data = Something::getDataFromRawQuery();
  
      return View::make('....')-&gt;with('data', $data);
  }
  </code></pre>
  
  <p>So my question is how to forward JSON data to the view from controller?</p>
  
  <p>Here is the query:</p>
  
  <pre><code>$apps = DB::query('SELECT a.name,
      a.desc,
      a.sig,
      ar.rate
      FROM something a
      INNER JOIN something_else ar
      ON (a.id=ar.something_id)
      ORDER BY ar.rate DESC'
   );
  
   return $apps;
  </code></pre>