I have two tables that has One to Many relationship.
Bookings - (id)
(id)
booking_tasks - (id, booking_id,user_id)
(id, booking_id,user_id)
one booking h
Have you tried ->first() combined with reversed orderBy()?
Like $q->where(‘user_id’,’=‘,’2’)->orderBy(‘id’,’DESC’)->first();