cable8mm/waybill 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cable8mm/waybill

最新稳定版本:v1.3.2

Composer 安装命令:

composer require cable8mm/waybill

包简介

A lightweight PHP library for generating PDF waybills with ease.

README 文档

README

Coding Style Actions Run Tests Actions Latest Version on Packagist Packagist Dependency Version Total Downloads Packagist Stars

A lightweight PHP library for generating PDF waybills with ease. This package allows developers to create and customize waybills in PDF format for courier and logistics services. It supports barcode generation, sender/receiver details, and customizable layouts. Perfect for automating shipping label creation in your e-commerce or logistics applications.

Installation

You can install the package via composer:

composer require cable8mm/waybill

Usage

Save a waybill for pdf format:

use Cable8mm\Waybill\Enums\ParcelService;
use Cable8mm\Waybill\Waybill;

Waybill::of(ParcelService::Cj)
    ->path(realpath(__DIR__.'/../dist'))
    ->save('test.pdf');

Get a waybill array:

$waybill = Waybill::of(ParcelService::Cj)
            ->toArray()

Save multiple waybills for pdf format:

$mpdf = Mpdf::instance();

WaybillCollection::of(mpdf: $mpdf)
    ->add(Waybill::of(ParcelService::Cj, mpdf: $mpdf))
    ->add(Waybill::of(ParcelService::Cj, mpdf: $mpdf))
    ->path(realpath(__DIR__.'/../dist'))
    ->save('collection.pdf');

// or

WaybillCollection::of(mpdf: $mpdf)
    ->add([
      Waybill::of(ParcelService::Cj, mpdf: $mpdf),
      Waybill::of(ParcelService::Cj, mpdf: $mpdf),      
      ])
    ->path(realpath(__DIR__.'/../dist'))
    ->save('collection.pdf');

Slice the page of the waybills:

Slicer::of(ParcelService::Cj, 1)
    ->source('source.pdf')
    ->save('one_page.pdf'); // or `->download('one_page.pdf')`

How to customize

If you want to add another parcel service like UPS, you would need to make Enums and Factory class, for example:

  1. Make UpsFactory.php into `src/Factories' folder.
  2. Make Enum element into src/Enums folder.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email cable8mm@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固