eloquent get unique column values code example
Example 1: get unique values in laravel
$users = User::select('name')->distinct()->get();
Example 2: eloquent get distinct
$ad->getcodes()->distinct('pid')->count('pid');
Example 3: laravel unique column except self
'required|unique:users,email,'.$this->id . ',user_id';