Answers for "laracel collection unique"

PHP
0

laravel collection unique

$collection = collect([1, 1, 2, 2, 3, 4, 2]);

$unique = $collection->unique();

$unique->values()->all();

// [1, 2, 3, 4]
Posted by: Guest on July-24-2021
0

laravel collection unique

$users = $users->unique();
Posted by: Guest on July-24-2021

Code answers related to "laracel collection unique"

Browse Popular Code Answers by Language