title: Rewrite the raw DB query to query builder in laravel 8
body: <p>I'm trying to convert a raw query to a Laravel query builder but when I use the raw method I can't make it to write in a query builder</p>
  <p>Here is my raw query</p>
  <pre><code>SELECT GROUP_CONCAT(CONCAT(a.qty,' ',a.uqc) SEPARATOR ' ,') as quantity,a.exporter 
  FROM (select sum(shipping_bill_items.quantity) as qty, `exporters`.name as exporter,`shipping_bill_items`.uqc
  from `shipping_bill_items`
  inner join `shipping_bill` on `shipping_bill`.`id` = `shipping_bill_items`.`shipping_bill_id`
  inner join `exporters` on `exporters`.`id` = `shipping_bill`.`exporter_id`
  group by `exporters`.name,`shipping_bill_items`.`uqc`
  ORDER BY `exporters`.`name` ASC ) a 
  group by a.exporter;
  </code></pre>
  <p>I tried to write seems couldn't help any please help me to rewrite this!</p>
  <p>below which I tired to rewrite attempt to solve the problem</p>
  <pre><code>$Details=DB::select('a.exporter')
          -&gt;addSelect(DB::raw(&quot;GROUP_CONCAT(CONCAT(a.qty,' ', a.uqc) SEPARATOR ' ,') as quantity&quot;))
          -&gt;from(&quot;select sum(shipping_bill_items.quantity) as qty, 'exporters'.name as exporter, 'shipping_bill_items'.uqc from 'shipping_bill_items' inner join 'shipping_bill' on 'shipping_bill'.'id' = 'shipping_bill_items'.'shipping_bill_id' inner join 'exporters' on 'exporters'.'id' = 'shipping_bill'.'exporter_id' group by 'exporters'.name, 'shipping_bill_items'.'uqc' ORDER BY 'exporters'.'name' ASC as a&quot;)
          -&gt;groupBy('a.exporter')
          -&gt;get();
  </code></pre>
  <p>I tried to add an image for references but I couldn't add it  here is the table that I want  to achieve a result</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>quantity</th>
  <th>exporter</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>45.65 MTS</td>
  <td>1st Exporter</td>
  </tr>
  <tr>
  <td>1404.25 LTR,114170 NO</td>
  <td>2nd Exporter</td>
  </tr>
  <tr>
  <td>5168 NOS,47856 PCS,74648 SET</td>
  <td>3ed Exporter</td>
  </tr>
  </tbody>
  </table>
  </div>