title: Extract value as comma separated list
body: <p>I have a list below and i want to get a list of value as comma-separated values:</p>
  
  <pre><code>[{"id":49},{"id":61},{"id":5},{"id":58}] 
  </code></pre>
  
  <p>I tried pluck but it only returns single value. I want:</p>
  
  <pre><code>49,61,5,58
  </code></pre>
  
  <p>I can do it in many ways but i want to do it in laravel way.</p>
  
  <p>Code:</p>
  
  <pre><code>   $locations = Location::select('id')-&gt;whereIn('id', function($query) use ($id)
              {
                  $query-&gt;select('location_id')
                      -&gt;from('users_locations')
                      -&gt;whereRaw('user_id ='.$id);
              })-&gt;get();
  </code></pre>