I'm trying to use the queryBuilder to get all the results from one table, paginated by 15 grouped by one field.
$data['invoices'] = InvoiceModel::selectRaw("*")
->groupBy('serie')
->paginate(15);
Laravel throws the following error:
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'projetoservidor.vendas_195295269.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select count(*) as aggregate from (select * from vendas_195295269 group by serie) as aggregate_table)
What should I do?
