I have a
CenterService entity (table
center_services) and there is two columns
I have an array of services ids and I need collection in return but without of duplication
service_id. I only need last record of that combination.
This is how I try:
$requiredServices = Service::whereRequiredService(true)->pluck('id'); return CenterService::whereIn('service_id', $requiredServices)->latest()->get();
but it's just order that collection with all duplicate data.