Category

Laravel

Category

Today, We are going to learn Laravel Extract zip/archive file using chumper/zipper. In the last article, we will learn how to create a zip file.  Also, We are going to use chumper zipper package to extract the zip file. First of all, We are going to install the package by the following command.

Laravel Extract zip/archive file using chumper/zipper

Once the package has installed we have to update the Providers and Aliases. Let’s open the config “config/app.php” file then append the Providers and Aliases like below.

The Chumper Zipper package is ready to use. Now, We going to extract the zip file. Let’s create the function to extract the zip file.

First of all, I get the zip file path for passing the first argument on the Zipper function. As a second argument, You should pass the valid directory where you want to extract the zip file. Now, run the code and check the zip file is an extract or not.

If you face any issue on extract zip file please write the comment below.