{"id":13563742,"url":"https://github.com/milon/barcode","last_synced_at":"2025-05-12T13:32:32.731Z","repository":{"id":27670773,"uuid":"31156775","full_name":"milon/barcode","owner":"milon","description":"Laravel Barcode Generator","archived":false,"fork":false,"pushed_at":"2025-04-30T18:34:36.000Z","size":286,"stargazers_count":1380,"open_issues_count":52,"forks_count":323,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-30T19:42:12.431Z","etag":null,"topics":["barcode","barcode-generator","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milon.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"milon","custom":"https://paypal.me/nuruzzamanmilon"}},"created_at":"2015-02-22T08:09:31.000Z","updated_at":"2025-04-30T18:34:40.000Z","dependencies_parsed_at":"2023-02-16T18:02:29.076Z","dependency_job_id":"9a80a01a-9f3d-4828-9628-da3dcf2094f2","html_url":"https://github.com/milon/barcode","commit_stats":{"total_commits":86,"total_committers":37,"mean_commits":2.324324324324324,"dds":0.686046511627907,"last_synced_commit":"7a8fe7d7641056dcb79092b37ed7dd9a9955f744"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milon%2Fbarcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milon%2Fbarcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milon%2Fbarcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milon%2Fbarcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milon","download_url":"https://codeload.github.com/milon/barcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253747984,"owners_count":21957844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","barcode-generator","laravel"],"created_at":"2024-08-01T13:01:22.819Z","updated_at":"2025-05-12T13:32:32.703Z","avatar_url":"https://github.com/milon.png","language":"PHP","readme":"[![Packagist Downloads](https://img.shields.io/packagist/dt/milon/barcode.svg)](https://packagist.org/packages/milon/barcode) \n[![Stable version](https://img.shields.io/packagist/v/milon/barcode.svg)](https://packagist.org/packages/milon/barcode) \n[![License](https://img.shields.io/packagist/l/milon/barcode.svg)](https://packagist.org/packages/milon/barcode)\n\n![Banner](./banner.png)\n\nThis is a barcode generation package inspired by \u003chttps://github.com/tecnickcom/TCPDF\u003e. Actually, I use that package's underline classes for generating barcodes. This package is just a wrapper of that package and adds compatibility with Laravel.\n\nI used the following classes of that package.\n\n- src/Milon/Barcode/Datamatrix.php (include/barcodes/datamatrix.php)\n- src/Milon/Barcode/DNS1D.php (tcpdf_barcodes_1d.php)\n- src/Milon/Barcode/DNS2D.php (tcpdf_barcodes_2d.php)\n- src/Milon/Barcode/PDF417.php (include/barcodes/pdf417.php)\n- src/Milon/Barcode/QRcode.php (include/barcodes/qrcode.php)\n\n[Read More on TCPDF website](http://www.tcpdf.org)\n\nThis package relies on [php-gd](http://php.net/manual/en/book.image.php) extension. So, make sure it is installed on your machine.\n\n## Installation\n\nBegin by installing this package through Composer. Just run following command to terminal-\n\n```shell script\ncomposer require milon/barcode\n```\n\nYou can also edit your project's `composer.json` file to require `milon/barcode`. Just make sure you choosed the compatible version of the package from the following table.\n\n## Compatibility\n\n| Laravel Version | Barcode Package Version |\n|-----------------|-------------------------|\n| 12.*            | ^12.0                   |\n| 11.*            | ^11.0                   |\n| 10.*            | ^10.0                   |\n| 9.*             | ^9.0                    |\n| 8.*             | ^8.0                    |\n| 7.*             | ^7.0                    |\n| 6.*             | ^6.0                    |\n| 5.0 and 5.1     | ^5.1                    |\n| 4.0, 4.1, 4.2   | ^4.2                    |\n\n## Configuration\n\n\u003e If you are using version 6 or above, then the Service Provider and aliases will be published automatically. For prior versions, please follow the below instruction.\n\nAfter updating Composer, add the service provider to your `config/app.php` file:\n\n```php\n'providers' =\u003e [\n    // ...\n    Milon\\Barcode\\BarcodeServiceProvider::class,\n]\n```\n\nFor Laravel version 4.*, add the following lines to your `app/config/app.php` file:\n\n```php\n'providers' =\u003e array(\n    // ...\n    'Milon\\Barcode\\BarcodeServiceProvider',\n)\n```\n\n**Make sure you have write permission to the storage path. By default it sets to `/storage` folder.**\n\n```php\n'aliases' =\u003e [\n    // ...\n    'DNS1D' =\u003e Milon\\Barcode\\Facades\\DNS1DFacade::class,\n    'DNS2D' =\u003e Milon\\Barcode\\Facades\\DNS2DFacade::class,\n]\n```\n\nFor version 4.2 alias will be like this-\n\n```php\n'aliases' =\u003e array(\n    // ...\n    'DNS1D' =\u003e 'Milon\\Barcode\\Facades\\DNS1DFacade',\n    'DNS2D' =\u003e 'Milon\\Barcode\\Facades\\DNS2DFacade',\n)\n```\n\n## Publishing Configuration\n\nTo customize the barcode settings (e.g., store path), publish the configuration file(s) by running the appropriate command in the terminal:\n\n```shell\n# Laravel 5.x\nphp artisan vendor:publish\n\n# Laravel 4.x\nphp artisan config:publish milon/barcode\n```\n\n## Usage\n\nBar-code generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)\n\ngenerator in html, png , jpeg embedded base64 code and SVG canvas\n\n```php\necho DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T');\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T');\necho '\u003cimg src=\"data:image/png,' . DNS1D::getBarcodePNG('4', 'C39+') . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T');\necho '\u003cimg src=\"data:image/png;base64,' . DNS1D::getBarcodePNG('4', 'C39+') . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodeJPGPath('4445645656', 'PHARMA2T');\necho '\u003cimg src=\"data:image/jpeg;base64,' . DNS1D::getBarcodeJPG('4', 'C39+') . '\" alt=\"barcode\"   /\u003e';\n```\n\n```php\necho DNS1D::getBarcodeSVG('4445645656', 'C39');\necho DNS2D::getBarcodeHTML('4445645656', 'QRCODE');\necho DNS2D::getBarcodePNGPath('4445645656', 'PDF417');\necho DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');\necho '\u003cimg src=\"data:image/png;base64,' . DNS2D::getBarcodePNG('4', 'PDF417') . '\" alt=\"barcode\"   /\u003e';\n```\n\n## Width and Height example\n\n```php\necho DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33);\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33);\necho '\u003cimg src=\"' . DNS1D::getBarcodePNG('4', 'C39+',3,33) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33);\necho '\u003cimg src=\"data:image/png;base64,' . DNS1D::getBarcodePNG('4', 'C39+',3,33) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodeJPGPath('4445645656', 'PHARMA2T',3,33);\necho '\u003cimg src=\"data:image/jpeg;base64,' . DNS1D::getBarcodeJPG('4', 'C39+',3,33) . '\" alt=\"barcode\"   /\u003e';\n```\n\n## Color\n\n```php\necho DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33,'green');\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33,'green');\necho '\u003cimg src=\"' . DNS1D::getBarcodePNG('4', 'C39+',3,33,array(1,1,1)) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0));\necho '\u003cimg src=\"data:image/png;base64,' . DNS1D::getBarcodePNG('4', 'C39+',3,33,array(1,1,1)) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodeJPGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0));\necho '\u003cimg src=\"data:image/jpeg;base64,' . DNS1D::getBarcodeJPG('4', 'C39+',3,33,array(1,1,1)) . '\" alt=\"barcode\"   /\u003e';\n```\n\n## Show Text\n\n```php\necho DNS1D::getBarcodeSVG('4445645656', 'PHARMA2T',3,33,'green', true);\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T',3,33,'green', true);\necho '\u003cimg src=\"' . DNS1D::getBarcodePNG('4', 'C39+',3,33,array(1,1,1), true) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodePNGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0), true);\necho '\u003cimg src=\"data:image/png;base64,' . DNS1D::getBarcodePNG('4', 'C39+',3,33,array(1,1,1), true) . '\" alt=\"barcode\"   /\u003e';\necho DNS1D::getBarcodeJPGPath('4445645656', 'PHARMA2T',3,33,array(255,255,0), true);\necho '\u003cimg src=\"data:image/jpeg;base64,' . DNS1D::getBarcodeJPG('4', 'C39+',3,33,array(1,1,1), true) . '\" alt=\"barcode\"   /\u003e';\n```\n\n## 2D Barcodes\n\n```php\necho DNS2D::getBarcodeHTML('4445645656', 'QRCODE');\necho DNS2D::getBarcodePNGPath('4445645656', 'PDF417');\necho DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');\n```\n\n## 1D Barcodes\n\n```php\necho DNS1D::getBarcodeHTML('4445645656', 'C39');\necho DNS1D::getBarcodeHTML('4445645656', 'C39+');\necho DNS1D::getBarcodeHTML('4445645656', 'C39E');\necho DNS1D::getBarcodeHTML('4445645656', 'C39E+');\necho DNS1D::getBarcodeHTML('4445645656', 'C93');\necho DNS1D::getBarcodeHTML('4445645656', 'S25');\necho DNS1D::getBarcodeHTML('4445645656', 'S25+');\necho DNS1D::getBarcodeHTML('4445645656', 'I25');\necho DNS1D::getBarcodeHTML('4445645656', 'I25+');\necho DNS1D::getBarcodeHTML('4445645656', 'C128');\necho DNS1D::getBarcodeHTML('4445645656', 'C128A');\necho DNS1D::getBarcodeHTML('4445645656', 'C128B');\necho DNS1D::getBarcodeHTML('4445645656', 'C128C');\necho DNS1D::getBarcodeHTML('4445645656', 'GS1-128');\necho DNS1D::getBarcodeHTML('44455656', 'EAN2');\necho DNS1D::getBarcodeHTML('4445656', 'EAN5');\necho DNS1D::getBarcodeHTML('4445', 'EAN8');\necho DNS1D::getBarcodeHTML('4445', 'EAN13');\necho DNS1D::getBarcodeHTML('4445645656', 'UPCA');\necho DNS1D::getBarcodeHTML('4445645656', 'UPCE');\necho DNS1D::getBarcodeHTML('4445645656', 'MSI');\necho DNS1D::getBarcodeHTML('4445645656', 'MSI+');\necho DNS1D::getBarcodeHTML('4445645656', 'POSTNET');\necho DNS1D::getBarcodeHTML('4445645656', 'PLANET');\necho DNS1D::getBarcodeHTML('4445645656', 'RMS4CC');\necho DNS1D::getBarcodeHTML('4445645656', 'KIX');\necho DNS1D::getBarcodeHTML('4445645656', 'IMB');\necho DNS1D::getBarcodeHTML('4445645656', 'CODABAR');\necho DNS1D::getBarcodeHTML('4445645656', 'CODE11');\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA');\necho DNS1D::getBarcodeHTML('4445645656', 'PHARMA2T');\n```\n\n# Running without Laravel\n\nYou can use this library without using Laravel.\n\nExample:\n\n```php\nuse \\Milon\\Barcode\\DNS1D;\n\n$d = new DNS1D();\n$d-\u003esetStorPath(__DIR__.'/cache/');\necho $d-\u003egetBarcodeHTML('9780691147727', 'EAN13');\n```\n\n## License\n\nThis package is published under `GNU LGPLv3` license and copyright to [Nuruzzaman Milon](http://milon.im). Original Barcode generation classes were written by Nicola Asuni. The license agreement is on project's root.\n\n### [Buy me a coffee ☕](https://paypal.me/tomilon?locale.x=en_US)\n\nLicense: GNU LGPLv3\u003cbr\u003e\nPackage Author: [Nuruzzaman Milon](http://milon.im)\u003cbr\u003e\nOriginal Barcode Class Author: [Nicola Asuni](http://www.tcpdf.org)\u003cbr\u003e\nPackage Copyright: Nuruzzaman Milon\u003cbr\u003e\nBarcode Generation Class Copyright:\u003cbr\u003e\nNicola Asuni\u003cbr\u003e\nTecnick.com LTD\u003cbr\u003e\nwww.tecnick.com\n","funding_links":["https://github.com/sponsors/milon","https://paypal.me/nuruzzamanmilon","https://paypal.me/tomilon?locale.x=en_US"],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilon%2Fbarcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilon%2Fbarcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilon%2Fbarcode/lists"}