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;
    }
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;
    }
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 ; }
Return an instance with the specified request attribute.

@param string $name The attribute name.
@param mixed $value The value of the attribute.
@return static
Return an instance with the specified request attribute .