public function add($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $innerKey => $innerValue) {
                Arr::set($this->variables, $innerKey, $innerValue);
            }
        } elseif ($key instanceof Closure) {
            $this->variables[] = $key;
        } else {
            Arr::set($this->variables, $key, $value);
        }

        return $this;
    }
public function add($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $innerKey => $innerValue) {
                Arr::set($this->variables, $innerKey, $innerValue);
            }
        } elseif ($key instanceof Closure) {
            $this->variables[] = $key;
        } else {
            Arr::set($this->variables, $key, $value);
        }

        return $this;
    }
public function add ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ innerKey => $ innerValue ) { Arr :: set ( $ this -> variables , $ innerKey , $ innerValue ) ; } } elseif ( $ key instanceof Closure ) { $ this -> variables [ ] = $ key ; } else { Arr :: set ( $ this -> variables , $ key , $ value ) ; } return $ this ; }
Add a variable.

@param array|string|\Closure $key
@param mixed                 $value

@return $this
Add a variable .