protected function suggestFor(string $preferenceKey) : Collection
	{
		$suggestions = Product::suggestionsFor($preferenceKey, $this->resolveTagsFor($preferenceKey))
			->whereNotIn('id', $this->excluding->all())
			->orderBy('rate_val', 'desc')
			->take($this->limit)
			->get();


		if ($suggestions->count() < $this->limit) {
			$suggestions = $suggestions->merge($this->completeWithRandomProducts($suggestions));
		}

		$this->excluding($suggestions);

		return $suggestions;
	}
protected function suggestFor(string $preferenceKey) : Collection
	{
		$suggestions = Product::suggestionsFor($preferenceKey, $this->resolveTagsFor($preferenceKey))
			->whereNotIn('id', $this->excluding->all())
			->orderBy('rate_val', 'desc')
			->take($this->limit)
			->get();


		if ($suggestions->count() < $this->limit) {
			$suggestions = $suggestions->merge($this->completeWithRandomProducts($suggestions));
		}

		$this->excluding($suggestions);

		return $suggestions;
	}
protected function suggestFor ( string $ preferenceKey ) : Collection { $ suggestions = Product :: suggestionsFor ( $ preferenceKey , $ this -> resolveTagsFor ( $ preferenceKey ) ) -> whereNotIn ( 'id' , $ this -> excluding -> all ( ) ) -> orderBy ( 'rate_val' , 'desc' ) -> take ( $ this -> limit ) -> get ( ) ; if ( $ suggestions -> count ( ) < $ this -> limit ) { $ suggestions = $ suggestions -> merge ( $ this -> completeWithRandomProducts ( $ suggestions ) ) ; } $ this -> excluding ( $ suggestions ) ; return $ suggestions ; }
Returns a products suggestion for the given key.

@param  string $preferenceKey

@return Collection
Returns a products suggestion for the given key .