I have this query which returns matching values.
Availability::select(DB::raw('count(start) as count,start'))
->whereIn('start', [100,200,300,400])
->groupBy('start')
->get();
And returns:
count | start
1 | 100
2 | 200
I want the show in the result also 0 count values. Like:
count | start
1 | 100
2 | 200
0 | 300
0 | 400
dd() with dates as values. ['2018-09-10', '2018-09-18', '2018-09-16','2018-09-15'].
array:1 [▼
0 => array:2 [▼
"count" => 1
"start" => "2018-09-10"
]
]
Any ideas? Thanks in advance :)