title: Retrieve all duplicate data and delete unduplicated data Laravel
body: <p>I have the following table, for example</p>
  <pre><code>|----|-------------|-----|-----|--------------------|
  | id |address      | log | lat | timestamp          |
  |----|-------------|-----|-----|--------------------|
  | 1  | New York    |14.20|0.22 |2019-10-21 14:00:01 |
  | 2  | New York    |14.20|0.22 |2019-10-21 14:00:01 |
  | 3  | New York    |14.20|0.22 |2019-10-21 14:00:01 |
  | 4  | Italy       |10.36|0.75 |2019-10-21 14:00:01 |
  | 5  | Spain       |10.36|0.75 |2019-10-21 14:00:01 |
  | 6  | London      |10.36|0.75 |2019-10-21 14:00:01 |
  |----|-------------|-----|-----|--------------------|
  </code></pre>
  <p>And for a select one, I want to have an array of data only with the duplicate ones.
  That is, id 1 New York and its data, id 2 New York and its data, id 3 New York and its data and the rest of Italy, Madrid and London should be deleted because they are not duplicates
  an item is duplicated if it appears more than once</p>
  <p>I tried this</p>
  <pre><code>Address::groupBy('address')-&gt;having(DB::raw('count(*)'), &quot;&gt;&quot;, &quot;1&quot;)-&gt;select('address')-&gt;get();
  </code></pre>
  <p>But all my addresses are taken over
  How do I get my duplicates back into an array?</p>