Answer the question
In order to leave comments, you need to log in
How to extract only unique records from the database by field Laravel 5.1?
Hello. the task is this, I have 8 records with the desired center_id, there are repeated part_number, 103, 105, I need the center_id to be pulled out and the unique part_number field filtered. So instead of 8, I saw 2 entries. How to do it?
Answer the question
In order to leave comments, you need to log in
It turned out like this $this->centerPricesWithCurrency->where('center_id', $center_id)->groupBy('part_number')->get();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question