I have an array like this , which I am getting as a result of a database query (Google BigQuery) :
Array
(
[0] => Array
(
[points] => 95
[user] => 434
[type] => 20
[identifier] => tv
[date] => 2016-11-01
)
[1] => Array
(
[points] => 349
[id] => 2989631
[type] => 20
[identifier] => app
[date] => 2016-11-01
)
)
and another one for identifiers :
Array
(
[tv] => 1
[app] => 2
)
What I need is to do is to transform the array as the identifier key has corresponding value from identifiers array. So it will look like :
Array
(
[0] => Array
(
[points] => 95
[user] => 434
[type] => 20
[identifier] => 1
[date] => 2016-11-01
)
[1] => Array
(
[points] => 349
[id] => 2989631
[type] => 20
[identifier] => 2
[date] => 2016-11-01
)
)
How can I do this using Laravel collections ?
I have been trying with transform function, but not getting an idea to return specific column from the multidimensional array.