Я получаю ошибку при выполнении ниже, хотя без groupBy она работает нормально.
User::select('col')->groupBy('col1')->chunk(100, function ($users) {
foreach ($users as $user) {
dump($user);
}
});
Ошибка:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column