$bookingd = Booking::where('status', '!=', 'assigned')
->whereIn('mechanic_id', $mechids)
->whereDate('created_at', 'not like', Carbon::now()->format('Y-m-d'));
if($userid!='')
$bookingd->where('mechanic_id', '!=', $userid);
$bookingd->groupBy('mechanic_id')->pluck('mechanic_id');
print_r($bookingd, true);
When i enable query log, get the command
select mechanic_id from bookings
where status
!= 'assigned' and mechanic_id
in (14,15,110,120,121,123,124,126,127,128,129,130) and date(created_at
) not like '2021-06-18' GROUP BY mechanic_id
which in return