Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pordonez's avatar

Laravel query structure

Hi all, i have a query where i need to collect my agent's commission daily transaction,

select a.fullname , DATE_FORMAT(b.created_at, "%M %d %Y") as mydate, sum(c.commission) from  agent a, job_orders b, service c
where a.id = b.therapist_fullname and
b.service = c.id group by a.fullname , mydate, c.commission

and i get this result with the format

| Agent Name | Friday | Saturday | etc etc
--------------------------------------------------------
|  Agent 1    |   50   |
|  Agent 1    |  100   |

and i want it something like this

| Agent Name | Friday | Saturday | etc etc
--------------------------------------------------------
|  Agent 1      |   50   |      100     |

can anyone help me with this?.

0 likes
0 replies

Please or to participate in this conversation.