public function update(string $key, $data)
	{
		if (is_string($data)) {
			$data = $this->normalizeToCollection($data);
		}

		if ($this->allowed->has($key)) {
			$this->updatePreferencesForKey(
				$key, $this->normalizedTags($data)
			);

			$this->updateCategories(
				$data->pluck('category_id')->unique()
			);
		}

		return $this;
	}
public function update(string $key, $data)
	{
		if (is_string($data)) {
			$data = $this->normalizeToCollection($data);
		}

		if ($this->allowed->has($key)) {
			$this->updatePreferencesForKey(
				$key, $this->normalizedTags($data)
			);

			$this->updateCategories(
				$data->pluck('category_id')->unique()
			);
		}

		return $this;
	}
public function update ( string $ key , $ data ) { if ( is_string ( $ data ) ) { $ data = $ this -> normalizeToCollection ( $ data ) ; } if ( $ this -> allowed -> has ( $ key ) ) { $ this -> updatePreferencesForKey ( $ key , $ this -> normalizedTags ( $ data ) ) ; $ this -> updateCategories ( $ data -> pluck ( 'category_id' ) -> unique ( ) ) ; } return $ this ; }
Updates the user preferences for a given key and data.

@param  string $key
@param  mixed $data

@return self
Updates the user preferences for a given key and data .