public function with($key, $value = null)
    {
        if (is_array($key)) {
            $this->attributes = array_merge($this->attributes, $key);
        } else {
            $this->attributes[$key] = $value;
        }

        return $this;
    }
public function with($key, $value = null)
    {
        if (is_array($key)) {
            $this->attributes = array_merge($this->attributes, $key);
        } else {
            $this->attributes[$key] = $value;
        }

        return $this;
    }
public function with ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { $ this -> attributes = array_merge ( $ this -> attributes , $ key ) ; } else { $ this -> attributes [ $ key ] = $ value ; } return $ this ; }
Set a custom class attribute.

@param mixed $key
@param mixed|null $value
@return $this
Set a custom class attribute .