protected function sanitize($preferences = null) : Collection
	{
		if (is_null($preferences) && $this->auth->check()) {
			return Collection::make($this->auth->user()->preferences);
		}

		if (is_null($preferences) && ! $this->auth->check()) {
			return $this->allowed;
		}

		if (is_string($preferences)) {
			$preferences = json_decode($preferences, true);
		}

		return Collection::make($preferences)->filter(function($item, $key) {
			return $this->allowed->has($key);
		});
	}