Answers for "distinct in eloquent collection"

PHP
4

eloquent get distinct

$ad->getcodes()->distinct('pid')->count('pid');
Posted by: Guest on September-20-2020
1

laravel collection distinct

$dataList = [1,2,4,5,3,2,1,98,1,2,4,5,6];

$dataList  = collect( $dataList )->unique();
Posted by: Guest on April-26-2022

Browse Popular Code Answers by Language