May 2, 2018
0
Level 1
Modal has many key unique meta data, I want to query it to be in one single array
I have a Lead model with id and name,
I have a dynamicFields model with id, lead_id, key, value
their is only one unique key per lead
they are relationed as lead has many dynamic fields
example: Lead 1, john doe
dynamicFields
1,1,height, 150
2,1,width, 90
3,1,budget, 1000
I want the end query result to produce a collection/array
[
'id' => 1,
'name' => 'john doe',
'height' => 150,
'width' => 90,
'budget' => 1000,
]
Please or to participate in this conversation.