The method for printing barcodes in Laravel is to use the Zebra ZPL. The Zebra ZPL is a standard for printing barcodes, you can simplely treat it as that you manually build some plain text and send it to the printer via socket.
Zebra ZPL
You can easily design your barcode by this online editor
http://staging.advanced-technology-group.com/
Or you can download a free tool to design your barcode, personal recommend this method
https://zpldesigner.com/
after that just copy your zpl code and treat it as your barcode template, later just replace the barcode data with your own data in code.
Sample code of Zebra ZPL
1 | ^XA |
the printed out barcode is like this