Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mhdev's avatar
Level 1

Barcode Scanner in Livewire

I'm looking to build some functionality that does the following (I'm using Laravel 12 and Livewire, with Alpine.js);

  • Button that opens the devices built-in camera
  • Detect and scan a barcode
  • Send that to my back-end

In particular I'm looking to scan the barcode of books, and retrieve the ISBN. I've had a look at Quagga.js but doesn't seem particularly reliable. Are there any other libraries, or built-in Livewire functionality that will allow me to do this?

0 likes
4 replies
martinbean's avatar

@mhdev Barcode detection is very much client-side. Laravel and Livewire are server-side. So yes, you’re going to need some form of JavaScript to transport any data interpreted client-side and send it to your back-end.

1 like
mhdev's avatar
Level 1

Thanks. Is there any libraries you'd recommend for this? All that I've come across are either poorly supported or really expensive, and the browser support for barcode api isn't great

RhysLees's avatar

i would recommend mebjas/html5-qrcode, I've used this on a few projects now and it works quite well.

Please or to participate in this conversation.