laravell clause to get distinct colum value code example Example: eloquent get distinct $ad->getcodes()->distinct('pid')->count('pid');