laravel get unique values from collection code example
Example 1: get unique values in laravel
$users = User::select('name')->distinct()->get();
Example 2: laravel rule unique where
'required|email|unique:company_users,email_address,NULL,id,company_id,' . $request->company_id