src/Wallhaven/Wallpaper.php
public function download($directory)
    {
        if (!file_exists($directory)) {
            if (!@mkdir($directory, null, true)) {
                throw new DownloadException("The download directory cannot be created.");
            }
        }

        $url = $this->getImageUrl();

        $this->client->get($url, [
            'save_to' => $directory . '/' . basename($url),
        ]);
    }
public function download($directory)
    {
        if (!file_exists($directory)) {
            if (!@mkdir($directory, null, true)) {
                throw new DownloadException("The download directory cannot be created.");
            }
        }

        $url = $this->getImageUrl();

        $this->client->get($url, [
            'save_to' => $directory . '/' . basename($url),
        ]);
    }
Download the wallpaper.

@param string $directory Where to download the wallpaper.

@throws DownloadException Thrown if the download directory cannot be created.