I hope someone can help me. I came across a very complex Laravel query and I don't know how to get out of it. My problem is that in the database I would like to group a series of columns so that the results of these groups are unique because they are repeated and select data from other columns belonging to these groups e.g. warehouse column is repeated 3 times I would like it to be displayed once, listing all the warehouse audit dates in another column and the results of these dates in another column. I wrote like this but I don't get the result. Can anyone help me understand what I'm doing wrong, thank you very much.. I would like to get some kind of graph..
-oh my 天.
$audit = DB::table('esiti_audit')->where('employee', $name)
->select('master_zone', 'subarea', 'microarea')
->groupByRaw('master_zone,subarea,microarea')
->orderByDesc('data_audit')->select('data_audit', 'esito')
->get();