Turn the current Medium into a Link

@param  bool $reset
@param  array  $attributes
@return Link
554390
public function link($reset = true, array $attributes = [])
    {
        if ($this->mode !== 'source') {
            $this->display('source');
        }

        foreach ($this->attributes as $key => $value) {
            empty($attributes['data-' . $key]) && $attributes['data-' . $key] = $value;
        }

        empty($attributes['href']) && $attributes['href'] = $this->url();

        return new Link($attributes, $this);
    }
974661
public function make(array $attributes = [])
    {
        $resolution = $this->resolution(
            isset($attributes['width']) ? $attributes['width'] : null,
            isset($attributes['height']) ? $attributes['height'] : null
        );

        return $this->faker->imageGenerator(
            null, // dir
            $resolution['width'],
            $resolution['height'],
            $attributes['type'], // jpg or png
            true, // fullpath
            (function_exists('imagettfbbox') ? (isset($attributes['text']) ? $attributes['text'] : $this->faker->word) : null),
            (isset($attributes['background']) ? $attributes['background'] : $this->faker->hexColor),
            (isset($attributes['color']) ? $attributes['color'] : $this->faker->hexColor)
        );
    }
279542
public function link($url, $title, $attributes = [])
    {
        $attributes['href'] = $url;
        $tag = new Tag('a', $attributes);
        $tag->setText($title);
        return $tag;
    }
749250
public function setLinkAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->link_attributes = $attributes;

        return $this;
    }
724947
public function setSchema($entry, $keys, $value, $reset = false, $reset_value = null)
    {
        // Reset existing values in the schema.
        if ($reset) {
            $current = $this->getSchema($entry);
            foreach ($current as $key => $value) {
                if (is_null($reset_value)) {
                    unset($this->schema[$key][$entry]);
                    continue;
                }

                array_set($this->model_schema, $key.'.'.$entry, $reset_value);
            }
        }

        // Keys can be a single string attribute.
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        // Update each of the keys.
        foreach ($keys as $key) {
            array_set($this->model_schema, $key.'.'.$entry, $value);
        }

        // Break the cache.
        $this->breakSchemaCache($entry.'_0');
        $this->breakSchemaCache($entry.'_1');

        return $this;
    }
512847
public static function link($href = '', $text = '', array $attributes = [])
    {
        $attributes = array_merge([
            'href'  => $href,
        ], $attributes);

        return self::tag('a', $attributes)->text($text);
    }
1041487
public function path($reset = true)
    {
        $output = $this->saveImage();

        if ($reset) {
            $this->reset();
        }

        return $output;
    }
104739
public function refresh(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            if ($this->has($attribute)) {
                $this->attributes[$this->resolveAttributeName($attribute)] = $value;
            } else {
                $this->attributes[$attribute] = $value;
            }
        }

        return $this;
    }
259882
public static function autolink(string $string, array $attributes = []): string
	{
		return preg_replace_callback('#\b(?<!href="|">)[a-z]+://\S+(?:/|\b)#i', function($matches) use ($attributes)
		{
			return (new HTML())->tag('a', ['href' => $matches[0]] + $attributes, $matches[0]);
		}, $string);
	}
1154616
public function sendResetLink(array $credentials): string
    {
        // First we will check to see if we found a user at the given credentials and
        // if we did not we will redirect back to this current URI with a piece of
        // "flash" data in the session to indicate to the developers the errors.

        if (\is_null($user = $this->getUser($credentials))) {
            return static::INVALID_USER;
        }

        // Once we have the reminder token, we are ready to send a message out to the
        // user with a link to reset their password. We will then redirect back to
        // the current URI having nothing set in the session to indicate errors.
        $user->sendPasswordResetNotification(
            $this->tokens->create($user), $this->provider
        );

        return static::RESET_LINK_SENT;
    }
281447
public function resourced($url, Model $model, array $attributes = [])
    {
        $method = 'POST';
        if ($model->exists) {
            $url    = "{$url}/{$model->getKey()}";
            $method = 'PUT';
        }
        array_set($attributes, 'method', $method);
        $this->with($model);
        $this->attributes(array_merge($attributes, [
            'url'    => handles($url),
            'method' => $method,
        ]));
        return $this;
    }
1322459
public static function LinkToUnlessCurrent($label, $url, array $attributes = array())
    {
        if (Request::matches($url)) {
            return $label;
        } else {
            return static::link($label, $url, $attributes);
        }
    }
988204
public function open($url, array $attributes = [])
    {
        $tag = new Tag('form', $attributes);
        $tag->action = $url;
        $tag->method = 'POST';
        return $tag;
    }
92665
public function link($entity, $attribute)
    {
        $this->entity = $entity;
        $this->attribute = $attribute;

        return $this;
    }
107888
public function link($url, $name = null, $attributes = [])
    {
        $name = (is_null($name)) ? $url : $name;
        $this->setLocation($url, strtolower(__FUNCTION__));
        $lingTag = '';
        $lingTag = '<a href="'.$this->getBaseUrl().Html::entities($url).'"
         '.$this->addAttributes($attributes).'>'.Html::entities($name).'</a>'.PHP_EOL;

        /*
        | If method called statically we will simply return
        | as string
        */
        if (isset($attributes['type']) && $attributes['type'] == 'static') {
            return trim($this->stripCarriage($lingTag));
        }

        $this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = trim($lingTag);

        return $this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)];
    }
807106
public function replaceAttributes(array $attributes)
    {
        $url = self::makeAttributeUrl();
        $data = json_encode(array("attribute" => $attributes));

        $replaced = $this->service->prepAndSend($url, array(200), 'PUT', $data, true);
        $replaced = json_decode($replaced);
        $result = array();
        foreach ($replaced->attribute as $attr) {
            $result[] = Attribute::createFromJSON($attr);
        }
        return $result;
    }
969930
public static function factory($link, array $attrs = [])
    {
        if (URL::getAssetId($link) > 0) {
            return new AssetLink($link, $attrs);
        }

        if (is_numeric($link) || URL::isInternal($link)) {
            return new PageLink($link, $attrs);
        }

        return new External($link, $attrs);
    }