承接 max13/laravel-barcode 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

max13/laravel-barcode

最新稳定版本:v0.3.2

Composer 安装命令:

composer require max13/laravel-barcode

包简介

Laravel package to manage and generate barcodes

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

With this package you can manage barcodes (external barcodes, checkings, etc…) or generate your own as long as you configure it correctly.

Installation

You can install the package via composer:

composer require max13/laravel-barcode

This package embeds corresponding fonts to write the barcode on a webpage. You will see how to use them in the Usage section below.

Configuration

Barcode types are available like so (defaults to ean13):

type has font
ean8 yes
ean13 yes

To change the barcode type used, set to your .env file: BARCODE_TYPE= with the barcode type you want to use.

When a barcode has a font and you would use it, you need to publish the package assets using:

php artisan vendor:publish --provider="Max13\Barcode\ServiceProvider" --tag=public

Don’t forget to include the css files in your layouts.

If you need to see or change this package config file, you can publish the config file using this command:

php artisan vendor:publish --provider="Max13\Barcode\ServiceProvider" --tag=config

This will export the config file to your app’s config folder.

Usage

// To check an ean13 barcode:
if (Barcode::isValid('0123456789104')) {
    // This barcode is valid
}

// To calculate an ean13 barcode check digit (the last digit)
echo Barcode::checksum('012345678910'); // Show: '4'

// To fix an ean13 barcode if it's needed
echo Barcode::fix('0123456789100'); // Show: '0123456789104'

And finally, if you need to write the barcode using the embedded font, you need to get the encoded form of the barcode (ex: in case of ean13, the font will be applied on html class f-ean13):

<span class="f-ean13">{{ Barcode::encode('0123456789104') }}</span>

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固