Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection find duplicates

$users = Users::all();
$usersUnique = $users->unique('id');
$usersDupes = $users->diff($usersUnique);

dd($users, $usersUnique, $usersDupes);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #find #duplicates
ADD COMMENT
Topic
Name
2+1 =