src/Wallhaven/Wallhaven.php
private function getToken()
    {
        $body = $this->client->get('/')->getBody()->getContents();

        $dom = new Dom();
        $dom->load($body);

        $token = $dom->find('input[name="_token"]')[0]->value;

        if (empty($token)) {
            throw new LoginException("Cannot find login token on Wallhaven's homepage.");
        }

        return $token;
    }
private function getToken()
    {
        $body = $this->client->get('/')->getBody()->getContents();

        $dom = new Dom();
        $dom->load($body);

        $token = $dom->find('input[name="_token"]')[0]->value;

        if (empty($token)) {
            throw new LoginException("Cannot find login token on Wallhaven's homepage.");
        }

        return $token;
    }
Get token for login.

@return string Token.
@throws WallhavenException Thrown if no token is found.