定制 vsolution-dev/laravel-zipper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vsolution-dev/laravel-zipper

最新稳定版本:0.0.2

Composer 安装命令:

composer require vsolution-dev/laravel-zipper

包简介

README 文档

README

Laravel Zipper Library

This library provides a convenient way to zip files in Laravel applications.

Installation

You can install this library using Composer. Run the following command:

composer require vsolution-dev/laravel-zipper

After the installation, you need to add the service provider and facade to your app.php configuration file.

Add the following line to the providers array:

VSolutionDev\LaravelZipper\ServiceProvider::class,

And add the following line to the aliases array:

'Zipper' => VSolutionDev\LaravelZipper\Facades\Zipper::class,

Requirements

This library requires PHP 7.4 or above. Make sure your server meets this requirement before installing.

Usage

To use this library, you can follow the example below:

$files = collect();

Qrcode::query()
    ->lazyById(1000)
    ->each(function ($qrcode) use ($files) {
        $files->add([
            'url' => $qrcode->url, // http://www.example.com/qrcode.png
            'name' => "{$qrcode->id}.png"
        ]);
    });

Zipper::queue($files, 'qrcodes.zip', 's3')
    ->allOnQueue('longtime')
    ->chain([
        (new SendMail())->attachFromStorageDisk('qrcodes.zip', 's3')
    ]);

In this example, after queuing the files for zipping using Zipper::queue(), we chain it with the SendMail job. The SendMail job is responsible for sending an email with the zip file attached. It uses the attachFromStorageDisk() method to attach the zip file from the specified storage disk ('s3' in this case).

Make sure you have the SendMail job defined with the appropriate logic to send the email. You may need to customize it according to your email sending implementation.

统计信息

  • 总下载量: 1.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固