I assume this is supposed to be a select?
->select('biker_id', DB::raw( 'COUNT(biker_id) WHERE status = 0 as "count"'))->get()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
$bookings = Booking::whereBetween('booking_date',[$date,$date_to])->whereIn('status',['collect_payment','end_visit'])->whereNotIn('user_id', $excludedUsers)->groupBy('biker_id')->get([
'biker_id',
DB::raw( 'COUNT( * ) WHERE status = 0 as "count"' )
]);
Please or to participate in this conversation.