Get value from an attribute.

@param string $name
@param mixed  $value

@return mixed
768186
public function getValueAttribute($name, $value = null)
    {
        if (strpos($name, '[]') !== false) {
            $name = str_replace('[]', '', $name);
        }

        if ($this->hasOldInput()) {
            return $this->getOldInput($name);
        }

        if ($this->hasModelValue($name)) {
            return $this->getModelValue($name);
        }

        return $value;
    }
273435
public function attribute($name)
    {
        if (isset($this->properties[$name])) {
            return $this->object->$name;
        }

        $getterName = 'get' . ucfirst($name);
        if (isset($this->getters[$getterName])) {
            return $this->object->$getterName();
        }

        throw new \InvalidArgumentException("Unsupported attribute '$name' for " . \get_class($this->object));
    }
823078
public static function get(String $name = NULL, $value = NULL)
    {
        return self::_method($name, $value, $_GET, __FUNCTION__);
    }
1122739
public function withAttribute($name, $value)
    {
        $request = $this->copy();
        
        $key = \Jasny\snakecase($name);
        $request->attributes[$key] = $value;
        
        return $request;
    }
1361475
public function getValue($name)
	{
		if (! isset($this->values[$name]))
		{
			$this->values[$name] = arg($name);
		}

		return $this->values[$name];
	}
564947
public function attr($name, $value = null)
    {
        if ($value === null) {
            return $this->getAttribute($name);
        }

        return $this->setAttribute($name, $value);
    }
725217
protected function setAttributeType($name, $value)
    {

        if (array_key_exists($name, $this->casts)) {
            if (in_array($this->casts[$name], $this->castTypes)) {
                settype($value, $this->casts[$name]);
            }
        }

        return $value;
    }
243468
public function getAttribute($name = null)
    {
        return is_null($name) ? $this->attributes : Arr::get($this->attributes, $name);
    }
246389
public function getAttr($name)
    {
        return isset($this->attrs[$name]) ? $this->attrs[$name] : null;
    }
825228
public function withAttribute($name, $value)
    {
        $attributes = $this->getAttributes();
        if (array_key_exists($name, $attributes) && $attributes[$name] === $value) {
            return $this;
        }

        $attributes[$name] = $value;

        $newInstance = clone $this;
        $newInstance->setAttributes($attributes);
        return $newInstance;
    }
357969
public function assignAttribute($name, $value)
	{
		$table = static::table();
		if (!is_object($value)) {
			if (array_key_exists($name, $table->columns)) {
				$value = $table->columns[$name]->cast($value, static::connection());
			} else {
				$col = $table->getColumnByInflectedName($name);
				if (!is_null($col)){
					$value = $col->cast($value, static::connection());
				}
			}
		}

		// convert php's \DateTime to ours
		if ($value instanceof \DateTime) {
			$value = new DateTime($value->format('Y-m-d H:i:s T'));
		}

		// make sure DateTime values know what model they belong to so
		// dirty stuff works when calling set methods on the DateTime object
		if ($value instanceof DateTime) {
			$value->attributeOf($this, $name);
		}

		$this->_attributes[$name] = $value;
		$this->flagDirty($name);
		return $value;
	}
465940
public static function get($name)
    {
        if (!isset(self::$converterMap[$name])) {
            throw new InvalidArgumentException(sprintf('Attribute converter "%s" is not valid.', $name));
        }

        return self::getInstanceOfConverter($name);
    }
515875
public function pull($name, $value = '')
    {
        $value = $this->get($name, $value);
        $this->delete($name);

        return $value;
    }
907776
public function getAttribute($name)
    {
        $method = 'get' . ucfirst($name) . 'Attribute';
        $value  = Arr::get($this->menu, $name);

        if (method_exists($this, $method)) {
            return $this->container->call([$this, $method], ['value' => $value]);
        }

        return $value;
    }
1039588
public function withAttribute($name, $value)
    {
        $new = clone $this;
        if (in_array($name, $this->emulatedAttributes, true)) {
            $new->{$name} = $value;
        } else {
            $new->attributes[$name] = $value;
        }

        return $new;
    }
704284
protected function fetchCssAttributeSelector($name, $value)
    {
        // if the attribute name starts with ^
        // example: *[^data-]
        if (substr($name, 0, 1) === '^') {
            $xpath = sprintf('@*[starts-with(name(), "%s")]', substr($name, 1));

            return $value === null ? $xpath : sprintf('%s="%s"', $xpath, $value);
        }

        // if the attribute name starts with !
        // example: input[!disabled]
        if (substr($name, 0, 1) === '!') {
            $xpath = sprintf('not(@%s)', substr($name, 1));

            return $xpath;
        }

        switch (substr($name, -1)) {
            case '^':
                $xpath = sprintf('starts-with(@%s, "%s")', substr($name, 0, -1), $value);
                break;
            case '$':
                $xpath = sprintf('ends-with(@%s, "%s")', substr($name, 0, -1), $value);
                break;
            case '*':
                $xpath = sprintf('contains(@%s, "%s")', substr($name, 0, -1), $value);
                break;
            case '!':
                $xpath = sprintf('not(@%s="%s")', substr($name, 0, -1), $value);
                break;
            case '~':
                $xpath = sprintf(
                    'contains(concat(" ", normalize-space(@%s), " "), " %s ")',
                    substr($name, 0, -1),
                    $value
                );
                break;
            default:
                // if specified only the attribute name
                $xpath = $value === null ? '@' . $name : sprintf('@%s="%s"', $name, $value);
                break;
        }

        return $xpath;
    }
355307
public static function get( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$_GET[ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return $_GET;
		} else {
			return ( isset( $_GET[ $name ] ) ) ? $_GET[ $name ] : NULL;
		}

	}