PHPackages                             dashed/receiptprinter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dashed/receiptprinter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dashed/receiptprinter
=====================

:description

v1.0.18(8mo ago)02481MITPHPCI failing

Since Sep 25Pushed 7mo agoCompare

[ Source](https://github.com/DashedCMS/receipt-printer)[ Packagist](https://packagist.org/packages/dashed/receiptprinter)[ Docs](https://github.com/Dashed-DEV/receiptprinter)[ RSS](/packages/dashed-receiptprinter/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (19)Used By (1)

Laravel Receipt Printer
=======================

[](#laravel-receipt-printer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/adce74445a606540aa6a541d270747a99ab8e8815378a171dac6783071eecae6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4461736865642f726563656970747072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Dashed/receiptprinter)[![Total Downloads](https://camo.githubusercontent.com/04f72a5910391c54708f73a7884cb41e6deb748adba6d7810f2a62ac01fd023b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4461736865642f726563656970747072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Dashed/receiptprinter)[![Build Status](https://camo.githubusercontent.com/bbba56a32645b81e7f4b4cde73076953ee4614cb1a752ca47730656a3120a4a4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4461736865642f726563656970747072696e7465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Dashed/receiptprinter)[![StyleCI](https://camo.githubusercontent.com/cb13a877afd1dbe223c631789c3f922d3ace958fdb334a9cce9b26afefbc2ebd/68747470733a2f2f7374796c6563692e696f2f7265706f732f31323334353637382f736869656c64)](https://styleci.io/repos/12345678)

Simple Laravel package to integrate ESC/POS Print Driver for PHP.

Installation
------------

[](#installation)

Via Composer

```
$ composer require Dashed/receiptprinter
```

Sample App
----------

[](#sample-app)

I have set up [a simple app](https://github.com/Dashed/receipt-printer-example) based on Laravel 7 to serve as a demo.

Usage
-----

[](#usage)

Execute the following command to publish the config used by this package:

```
$ php artisan vendor:publish --tag=receiptprinter.config

```

Edit the config file located at `config/receiptprinter.php` as follows:

1. Set `connector_type` to:
    - `windows` if you are using Windows as your web server.
    - `cups` if you are using Linux or Mac as your web server.
    - `network` if you are using a network printer.
2. Set `connector_descriptor` to:
    - the printer name if your `connector_type` is either `windows` or `cups`
    - the IP address or Samba URI, e.g: `smb://192.168.0.5/PrinterName` if your `connector_type` is `network`
3. Set `connector_port` to the open port for the printer, only if your `connector_type` is `network`

Include the library:

```
use Dashed\ReceiptPrinter\ReceiptPrinter as ReceiptPrinter;

```

Then use any one of these two functions to send "print" command to the printer.

```
printReceipt()

```

```
printRequest()

```

Example (Print Receipt)
-----------------------

[](#example-print-receipt)

```
use Dashed\ReceiptPrinter\ReceiptPrinter as ReceiptPrinter;

...

// Set params
$mid = '123123456';
$store_name = 'YOURMART';
$store_address = 'Mart Address';
$store_phone = '1234567890';
$store_email = 'yourmart@email.com';
$store_website = 'yourmart.com';
$tax_percentage = 10;
$transaction_id = 'TX123ABC456';
$currency = 'Rp';
$image_path = 'logo.png';

// Set items
$items = [
    [
        'name' => 'French Fries (tera)',
        'qty' => 2,
        'price' => 65000,
    ],
    [
        'name' => 'Roasted Milk Tea (large)',
        'qty' => 1,
        'price' => 24000,
    ],
    [
        'name' => 'Honey Lime (large)',
        'qty' => 3,
        'price' => 10000,
    ],
    [
        'name' => 'Jasmine Tea (grande)',
        'qty' => 3,
        'price' => 8000,
    ],
];

// Init printer
$printer = new ReceiptPrinter;
$printer->init(
    config('receiptprinter.connector_type'),
    config('receiptprinter.connector_descriptor')
);

// Set store info
$printer->setStore($mid, $store_name, $store_address, $store_phone, $store_email, $store_website);

// Set currency
$printer->setCurrency($currency);

// Add items
foreach ($items as $item) {
    $printer->addItem(
        $item['name'],
        $item['qty'],
        $item['price']
    );
}
// Set tax
$printer->setTax($tax_percentage);

// Calculate total
$printer->calculateSubTotal();
$printer->calculateGrandTotal();

// Set transaction ID
$printer->setTransactionID($transaction_id);

// Set logo
// Uncomment the line below if $image_path is defined
//$printer->setLogo($image_path);

// Set QR code
$printer->setQRcode([
    'tid' => $transaction_id,
]);

// Print receipt
$printer->printReceipt();

```

Example (Print Request)
-----------------------

[](#example-print-request)

```
use Dashed\ReceiptPrinter\ReceiptPrinter as ReceiptPrinter;

...

// Set params
$mid = '123123456';
$store_name = 'YOURMART';
$store_address = 'Mart Address';
$store_phone = '1234567890';
$store_email = 'yourmart@email.com';
$store_website = 'yourmart.com';
$tax_percentage = 10;
$transaction_id = 'TX123ABC456';
$currency = 'Rp';
$image_path = 'logo.png';

// Init printer
$printer = new ReceiptPrinter;
$printer->init(
    config('receiptprinter.connector_type'),
    config('receiptprinter.connector_descriptor')
);

// Set store info
$printer->setStore($mid, $store_name, $store_address, $store_phone, $store_email, $store_website);

// Set currency
$printer->setCurrency($currency);

// Set request amount
$printer->setRequestAmount($request_amount);

// Set transaction ID
$printer->setTransactionID($transaction_id);

// Set logo
// Uncomment the line below if $image_path is defined
//$printer->setLogo($image_path);

// Set QR code
$printer->setQRcode([
    'tid' => $transaction_id,
    'amount' => $request_amount,
]);

// Print payment request
$printer->printRequest();

```

Changelog
---------

[](#changelog)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Problems
--------

[](#problems)

If you discover any issues, please post the details on the [issue tracker](https://github.com/Dashed/receipt-printer/issues).

Credits
-------

[](#credits)

- *Mike42* for the awesome [PHP ESC/POS Print Driver](https://github.com/mike42/escpos-php "PHP ESC/POS Print Driver") library

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance61

Regular maintenance activity

Popularity13

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~11 days

Total

18

Last Release

246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7b24523d1886867475cbc2b4342b54b4427055e5b03745170d5299d2946cae7?d=identicon)[Robinvm](/maintainers/Robinvm)

---

Top Contributors

[![charlieuki](https://avatars.githubusercontent.com/u/45746232?v=4)](https://github.com/charlieuki "charlieuki (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![animaster](https://avatars.githubusercontent.com/u/2392133?v=4)](https://github.com/animaster "animaster (2 commits)")[![MustafaRaarujeed](https://avatars.githubusercontent.com/u/14356467?v=4)](https://github.com/MustafaRaarujeed "MustafaRaarujeed (2 commits)")

---

Tags

laravelReceiptPrinter

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dashed-receiptprinter/health.svg)

```
[![Health](https://phpackages.com/badges/dashed-receiptprinter/health.svg)](https://phpackages.com/packages/dashed-receiptprinter)
```

###  Alternatives

[charlieuki/receiptprinter

:description

15344.7k](/packages/charlieuki-receiptprinter)[stephenjude/filament-blog

Filament Blog Builder

20619.4k](/packages/stephenjude-filament-blog)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11273.0k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
