id | agent_id | currency |
---|---|---|
1 | A0001 | IDR |
2 | A0002 | MYR |
3 | A0001 | THB |
example currently have a dataset as above, is it have any way to using only 1 query builder to get the outcome like below
Output:
[
"agent_id" => "A0001",
"currency" => [
"IDR",
"THB",
],
],
[
"agent_id" => "A0002"
"currency" => ["MYR"]
]
Basically likes try to pluck the currency under same agent
Appreciate for all the suggestion.