PHP code example of exeque / laravel-zipstream

1. Go to this page and download the library: Download exeque/laravel-zipstream library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

exeque / laravel-zipstream example snippets


use ExeQue\ZipStream\Facades\Zip;

// Stream an archive to the browser
return Zip::as('gallery.zip')
    ->fromDisk('s3', 'events/2026/photo.jpg')
    ->fromLocalDirectory('/var/exports/2026', 'exports')
    ->fromRaw('README.txt', 'Thanks for downloading!')
    ->toResponse();

// Or build it straight to a disk, while it uploads
Zip::fromDiskDirectory('s3', 'events/2026', 'gala')
    ->saveToDisk('s3', 'archives/gala.zip');