$users = User::all(); $usersUnique = $users->unique(['user_name']); $userDuplicates = $users->diff($usersUnique); echo "<pre>"; print_r($userDuplicates->toArray());