I need to get the count of records and need to display the result by duplicating in all of the records in the return result.
{
"id": 1,
"count1": "5"
}
As the json response currently I received the above output. But I need it is as follows.
{
"id": 1,
"count1": "5"
},
{
"id": 2,
"count1": "5"
},
{
"id": 3,
"count1": "5"
}
My attempted query as below.
$query = 'SELECT c.id, count(c) count1 FROM App\Entity\Car c';
How can I achieve my expected result?