Laravel\Installer\Console\NewCommand::download PHP Method

download() protected method

Download the temporary Zip to the given file.
protected download ( string $zipFile, string $version = 'master' )
$zipFile string
$version string
    protected function download($zipFile, $version = 'master')
    {
        switch ($version) {
            case 'develop':
                $filename = 'latest-develop.zip';
                break;
            case 'master':
                $filename = 'latest.zip';
                break;
            case '5.2':
                $filename = 'latest-52.zip';
                break;
        }
        $response = (new Client())->get('http://cabinet.laravel.com/' . $filename);
        file_put_contents($zipFile, $response->getBody());
        return $this;
    }