Download the PHP package motekar/laravel-zip without Composer

On this page you can find all versions of the php package motekar/laravel-zip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-zip

Laravel Zip - Create and Manage Zip Archives in Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a simple and intuitive way to create and manage Zip archives in Laravel applications. It wraps PHP's ZipArchive class with additional convenience methods and fluent syntax.

Quick Example

This code creates a zip file named images.zip in the storage directory, containing all files from the storage/images/ folder.

Installation

Install the package via Composer:

Usage

Important Notes:

  1. Always call ->close() at the end to write changes to disk
  2. Most methods are chainable except:
    • getFileContent
    • getStatus
    • close
    • extractTo

API Reference

make($pathToFile)

Creates or opens a zip archive. If the file doesn't exist, it creates a new one. Returns the ZipManager instance for method chaining.

add($filesOrFolder)

Adds files or folders to the archive. Accepts:

addString($filename, $content)

Adds a file to the archive using string content.

remove($files)

Removes files from the archive. Accepts:

folder($folder)

Sets the working folder for subsequent operations.

listFiles($regexFilter = null)

Lists files in the archive. Optionally filters files using a regex pattern.

Note: Ignores the folder set with folder()

Examples:

home()

Resets the folder pointer to the root.

getFileContent($filePath)

Returns the content of a file from the archive or false if not found.

getStatus()

Returns the opening status of the zip archive as an integer.

close()

Writes all changes and closes the archive.

extractTo($path, $files = [], $flags = 0)

Extracts archive contents to the specified path. Supports:

Examples:

extractMatchingRegex($path, $regex)

Extracts files matching a regular expression pattern.

Examples:

Important Notes:

  1. PHP's ZipArchive uses '/' as the directory separator
  2. Windows users should use '/' in patterns instead of '\'

Credits

License

This package is open-source software licensed under the Apache Version 2.0 license.


All versions of laravel-zip with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-zip Version *
illuminate/filesystem Version ^10.0||^11.0
illuminate/support Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.17
spatie/temporary-directory Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package motekar/laravel-zip contains the following files

Loading the files please wait ....