src/Concerns/InteractsWithPages.php
protected function click($name)
    {
        $link = $this->crawler()->selectLink($name);

        if (! count($link)) {
            $link = $this->filterByNameOrId($name, 'a');

            if (! count($link)) {
                throw new InvalidArgumentException(
                    "Could not find a link with a body, name, or ID attribute of [{$name}]."
                );
            }
        }

        $this->visit($link->link()->getUri());

        return $this;
    }
protected function click($name)
    {
        $link = $this->crawler()->selectLink($name);

        if (! count($link)) {
            $link = $this->filterByNameOrId($name, 'a');

            if (! count($link)) {
                throw new InvalidArgumentException(
                    "Could not find a link with a body, name, or ID attribute of [{$name}]."
                );
            }
        }

        $this->visit($link->link()->getUri());

        return $this;
    }
protected function click ( $ name ) { $ link = $ this -> crawler ( ) -> selectLink ( $ name ) ; if ( ! count ( $ link ) ) { $ link = $ this -> filterByNameOrId ( $ name , 'a' ) ; if ( ! count ( $ link ) ) { throw new InvalidArgumentException ( "Could not find a link with a body, name, or ID attribute of [{$name}]." ) ; } } $ this -> visit ( $ link -> link ( ) -> getUri ( ) ) ; return $ this ; }
Click a link with the given body, name, or ID attribute.

@param  string  $name
@return $this

@throws \InvalidArgumentException
Click a link with the given body name or ID attribute .