use guzzle to get a file code example Example: guzzle download file $client->request('GET', '/stream/20', ['sink' => '/path/to/file']);