tigerranger/barcodepos

Laravel 6.*.* 的条码生成器和POS机集成

dev-master 2020-03-05 06:42 UTC

This package is auto-updated.

Last update: 2024-09-13 12:54:46 UTC


README

Laravel 6.x | 7.x PHP 7.x License

此包旨在处理条码图像和POS机集成。

要求

文档

快速安装

$ composer require tigerranger/barcodepos

服务提供者和外观(Laravel 6.x上的可选)

在您的 config/app.php 文件上注册提供者和外观。

'providers' => [
    ...,
    tigerranger\Barcode\Barcode::class,
	tigerranger\Barcode\POS::class
]

'aliases' => [
    ...,
    'Barcode' => tigerranger\Barcode\Barcode::class,
	'POS'=>tigerranger\Barcode\POS::class
]

就这样!开始构建一些出色的条码和POS软件吧!

在控制器中使用

        $barcode = new \tigerranger\Barcode\Barcode;
        $pos = new \tigerranger\Barcode\POS;
        $image= 'abbas.jpg'; // Name of the image
        $code= '0001CLSK729237';
        $barcode->set_barcode($code)  // Barcode Data max 15
                ->set_basepath(base_path()) // base path
                ->set_image_path("/public/barcode/$image"); // image name with path
        return view('amp.test')->with(compact('barcode','code','pos'));

在Blade模板中使用

<img src="{{ asset('').$barcode->getBarcodeImage() }}" width="200" height="auto" />
<p>{{$code}}</p>

{!! $pos->setPOS(asset('')) !!}

<script>
    var pos= new POS({"fire":kmyfn}); // fire is function which call when POS machine read data
	pos.get_barcode() /* Change data when POS machine read data ---------
     -----------------   only for vue js , angular js , react js etc similar FM */
    function kmyfn(barcode){
        alert(barcode);   // write your own function and enjoy
    }
</script>

安全

如果您发现任何与安全相关的问题,请通过电子邮件 omerabba009@gmail.com 联系,而不是使用问题跟踪器。

鸣谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件