create a duplicate of query without altering original laravel code example
Example 1: laravel collection remove duplicates
$unique = $collection->unique();
Example 2: laravel collection find duplicates
$users = Users::all();
$usersUnique = $users->unique('id');
$usersDupes = $users->diff($usersUnique);
dd($users, $usersUnique, $usersDupes);