title: Laravel DB:select() requires all columns in the group by
body: <p>I need to run a custom query and I have tried all these methods</p>
  
  <pre><code>$sql = "SELECT acd.*, DATE_FORMAT(acd.cdate, '%d/%m/%Y') cdate_disp,
    GROUP_CONCAT(CONCAT_WS(', ', car.type, car.session, crd.name) SEPARATOR '&lt;br /&gt;') rd_names,
    acb.booking_status my_booking_status
  FROM app_data acd
  INNER JOIN crmaccounts ca ON ca.id = acd.client_crm_id
  LEFT JOIN crmaccount_rdids car ON car.account_id = ca.id
  LEFT JOIN crmrd_ids crd ON crd.id = car.rd_id
  LEFT JOIN app_bookings acb ON acb.call_ref_id = acd.call_ref AND acb.user_id = 12391
  WHERE 1=1 
  AND acd.client_crm_id NOT IN (select account_id from bstaff WHERE user_id=12391)
  GROUP BY acd.id
  ORDER BY acd.cdate, ctiming";
  
  DB:select($sql);
  </code></pre>
  
  <p>throws</p>
  
  <blockquote>
    <p>Illuminate \ Database \ QueryException (42000)
    SQLSTATE[42000]: Syntax error or access violation: 1055 'mydatabase.acd.call_ref' isn't in GROUP BY (SQL: ....)</p>
  </blockquote>
  
  <pre><code>DB::select($sql);
  
  DB::raw($sql);
  
  DB::select(DB::raw($sql));
  
  //even with pdo 
  $sth = DB::getPdo()-&gt;prepare($sql);
  $sth-&gt;execute();
  $data = $sth-&gt;fetchAll(\PDO::FETCH_OBJ);
  
   PDOException (42000)
  SQLSTATE[42000]: Syntax error or access violation: 1055 'mydatabase.acd.call_ref' isn't in GROUP BY
  </code></pre>
  
  <p>It seems like the only way to get working is to list all the table columns in the <code>group by</code> which is doable but not convenient. </p>
  
  <p>I am able to run the same query directly in the phpmyadmin. So I am not sure why when I run it through Laravel it asks me add all columns.</p>
  
  <p>I have MariaDB installed and both Laravel and PhpMyAdmin are connecting to the same instance. Larvel version is 5.8.5.</p>
  
  <p>Please take a look at full query as I asked question here too but couldn't find any answer - <a href="https://laracasts.com/discuss/channels/eloquent/query-runs-ok-in-phpmyadmin-but-dbselect-throws-exception" rel="nofollow noreferrer">https://laracasts.com/discuss/channels/eloquent/query-runs-ok-in-phpmyadmin-but-dbselect-throws-exception</a></p>