where(ExternalProfile::ATTRIBUTE_VISIBILITY, ExternalProfileVisibility::PUBLIC->value); if ($user = Auth::user()) { return $builder->orWhereBelongsTo($user, ExternalProfile::RELATION_USER); } return $builder; } }