src/System/Controllers/ModuleController.php
public function store(UploadModuleRequest $request)
    {
        $path = storage_path('app/' . $request->module_zip_file->store('public/uploads/modules'));

        $zip = new ZipArchive;

        if ($zip->open($path) === true) {
            $extractPath = base_path('modules');
            $zip->extractTo($extractPath);
            $zip->close();

            return redirect()->route('admin.module.index')
                        ->with('notificationText', 'Module Extracted successfully');
        } else {
            return redirect()
                    ->back()
                    ->with('errorNotificationText', 'There is some issue: Please check your permission and try again later!');
        }
    }
public function store(UploadModuleRequest $request)
    {
        $path = storage_path('app/' . $request->module_zip_file->store('public/uploads/modules'));

        $zip = new ZipArchive;

        if ($zip->open($path) === true) {
            $extractPath = base_path('modules');
            $zip->extractTo($extractPath);
            $zip->close();

            return redirect()->route('admin.module.index')
                        ->with('notificationText', 'Module Extracted successfully');
        } else {
            return redirect()
                    ->back()
                    ->with('errorNotificationText', 'There is some issue: Please check your permission and try again later!');
        }
    }
public function store ( UploadModuleRequest $ request ) { $ path = storage_path ( 'app/' . $ request -> module_zip_file -> store ( 'public/uploads/modules' ) ) ; $ zip = new ZipArchive ; if ( $ zip -> open ( $ path ) === true ) { $ extractPath = base_path ( 'modules' ) ; $ zip -> extractTo ( $ extractPath ) ; $ zip -> close ( ) ; return redirect ( ) -> route ( 'admin.module.index' ) -> with ( 'notificationText' , 'Module Extracted successfully' ) ; } else { return redirect ( ) -> back ( ) -> with ( 'errorNotificationText' , 'There is some issue: Please check your permission and try again later!' ) ; } }
Store and Extract upload module zip files

@param \AvoRed\Framework\Http\Requests\UploadModuleRequest $request
@return \Illuminate\Http\RedirectResponse
Store and Extract upload module zip files