Returning full duplicate rows using Laravel’s query builder

I am looking to return the full information on duplicate records from my table.

I am currently using the following:

                ->havingRaw('COUNT(*) > 1')

Which is great, it returns the duplicate records, however, this only returns one of the records I need to return all the duplicates so that I can greet the user with a choice on which one to delete or keep.

How can I modify the above query to accomplish that?

Source: laravel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.