title: How can I convert int to string in laravel eloquent?
body: <p>My mysql query is like this :</p>
  
  <pre><code>SELECT b.id, b.name, COUNT(*) AS count_store
  FROM stores a
  JOIN locations b ON CONVERT(b.id,CHAR) = a.address-&gt;'$."regency_id"'
  GROUP BY b.id
  ORDER BY count_store DESC
  LIMIT 10 
  </code></pre>
  
  <p>If mysql query I use this : <code>CONVERT(b.id,CHAR)</code> to convert int to string</p>
  
  <p>How can I convert int to string in laravel eloquent? I'm using Laravel 5.3.</p>
  
  <p>I had try like this :</p>
  
  <pre><code>$stores = Store::select('locations.name','COUNT(*) AS count_store')
                 -&gt;join('locations', 'locations.id', '=', 'stores.address-&gt;regency_id')
                 -&gt;groupBy('locations.id')
                 -&gt;orderBy('count_store', 'desc')
                 -&gt;limit(10)
                 -&gt;get();
  </code></pre>
  
  <p>But it does not work</p>