src/Concerns/InteractsWithPages.php
protected function getForm($buttonText = null)
    {
        try {
            if ($buttonText) {
                return $this->crawler()->selectButton($buttonText)->form();
            }

            return $this->crawler()->filter('form')->form();
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException(
                "Could not find a form that has submit button [{$buttonText}]."
            );
        }
    }
protected function getForm($buttonText = null)
    {
        try {
            if ($buttonText) {
                return $this->crawler()->selectButton($buttonText)->form();
            }

            return $this->crawler()->filter('form')->form();
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException(
                "Could not find a form that has submit button [{$buttonText}]."
            );
        }
    }
protected function getForm ( $ buttonText = null ) { try { if ( $ buttonText ) { return $ this -> crawler ( ) -> selectButton ( $ buttonText ) -> form ( ) ; } return $ this -> crawler ( ) -> filter ( 'form' ) -> form ( ) ; } catch ( InvalidArgumentException $ e ) { throw new InvalidArgumentException ( "Could not find a form that has submit button [{$buttonText}]." ) ; } }
Get the form from the page with the given submit button text.

@param  string|null  $buttonText
@return \Symfony\Component\DomCrawler\Form

@throws \InvalidArgumentException
Get the form from the page with the given submit button text .