Add a piece of shared data to the factory.

@param string $key
@param mixed $value
331354
public function share($key, $value = null)
    {
        if (! is_array($key)) {
            return parent::share($key, $this->decorate($value));
        }

        return parent::share($this->decorate($key));
    }
348415
public function addAdditionalData(string $key, $value): self
    {
        $this->additionalData[$key] = $value;

        return $this;
    }
1222596
public function add($key, $value)
    {
        if (!is_null($value)) {
            $this->data[$key] = $value;
        }

        return $this;
    }
784098
public function push($key, $value = null)
    {
        if (is_null($value)) {
            $this->items[] = $key;

            return;
        }

        $items = $this->get($key);

        if (is_array($items) || is_null($items)) {
            $items[] = $value;
            $this->set($key, $items);
        }
    }
694330
public function add($key, $value){
        if( $this->exists($key) ){
            throw new Exception("Item already exists in storage ($key)  ($this->name)");
        }
        $this->storage[$key] = $value;
        return $this->storage[$key];

    }
889499
public function addMeta(string $key, $value): void
	{
		Arr::set($this->meta, $key, $value);
	}
940295
public function put( $key, $value = null ) {
		if ( ! is_array( $key ) ) {
			$key = [ $key => $value ];
		}

		foreach ( $key as $array_key => $array_value ) {
			Arr::set( $this->attributes, $array_key, $array_value );
		}
	}
288648
public function add($key, $value = null, $pop = false)
    {
        return self::addValue($this->data, $key, $value, $pop);
    }
1116481
protected function mergeDataEntry($value, $key) {
        if (!isset($this->shared[$key])) {
            $this->shared[$key] = $value;
        } elseif (isset($this->shared[$key]['#merged'])) {
            $this->shared[$key]['#value'][] = $value;
        } else {
            $oldValue = $this->shared[$key];
            $this->shared[$key] = [
                '#merged' => true,
                '#value' => [$oldValue, $value]
            ];
        }
    }
1297037
public function add($key, $value) {
		if ($key === null) {
			if (!is_array($this->data)) {
				$this->data = array();
			}
			$this->data[] = $value;
		} else {
			if (isset($this->data[$key]) && is_array($this->data[$key])) {
				$this->data[$key][] = $value;
			} else {
				$this->data[$key] = array();
				$this->data[$key][] = $value;
			}
		}
	}
265763
public static function put($key, $value)
    {
        Cache::ensureCacheDirectoryExists($path = Cache::path($key));
        file_put_contents($path, $value);
    }
338012
public function setCache($key, $value) {
        if($this->cacheEnabled) {
            $this->cacheObj->save($key, $value);
        }
    }
1256447
public function setAttribute($key, $value)
    {
        if (array_key_exists($key, $this->attachedFiles)) {

            if ($value) {
                $attachedFile = $this->attachedFiles[ $key ];

                if ($value === $this->getDeleteAttachmentString()) {
                    $attachedFile->setToBeDeleted();
                    return;
                }

                /** @var StorableFileFactoryInterface $factory */
                $factory = app(StorableFileFactoryInterface::class);

                $attachedFile->setUploadedFile(
                    $factory->makeFromAny($value)
                );
            }

            $this->attachedUpdated = true;

            return;
        }

        parent::setAttribute($key, $value);
    }
726305
public function add($key, $value)
    {
        if (! isset($this->attributes[$key])) {
            $this->attributes[$key] = array();
        }

        $this->attributes[$key][] = $value;

        return $this;
    }
795739
public function offsetSet($key, $value)
    {
        if ($key === null) {
            array_push($this->storage, $value);

            return;
        }

        $this->storage[$key] = $value;
    }
1204130
protected function addParam($key, $value = null)
	{
		if (is_null($value))
		{
			$this->params[] = $key;
		}
		else
		{
			$this->params[$key] = $value;
		}

	}
774449
public function share($key, $value = null)
    {
        $keys = is_array($key) ? $key : [$key => $value];

        foreach ($keys as $key => $value) {
            $this->shared[$key] = $value;
        }

        return $value;
    }