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

Friedrich's avatar

Insert a data to database using qr code

Can you help me on how insert a data to database using scanning a qr code in laravel my thoughts is the qr code has the url that generate a token and the auth user email then pass at a web url then my step 1 is i want to insert a data to database using qr code first that's was my problem how can i do that. Thanks in advance for the help.

0 likes
9 replies
MohamedTammam's avatar

Find out how your URL should look like that will process the steps. Then at the end use any package the transform that URL to QR code.

2 likes
azbx's avatar

@MohamedTammam

you could just create a qr code that goes to a link that in turn runs a query script.

2 likes
Friedrich's avatar

@[aeo] that was possible? How can i do that can you give me an example

1 like
martinbean's avatar

@friedrich You can call a URL. What that URL does is up to you though. And consider the security implications of rows being written to a database by merely accessing a URL. Because there’s also no difference to a user accessing a URL via scanning a QR code, and then also just manually typing and accessing that URL.

1 like
Friedrich's avatar

I was wondering if i successfully scanned the qr code, the url will show up in my phone for example? Even the localhost was 127.0.1:8000 something like that?

martinbean's avatar

@Friedrich Yes. A QR code is just some encoded data, and that data can be a URL. There’s nothing “hidden” or “secret” when it comes to data in QR codes.

If you create a QR code for a URL, then consider that URL public.

Snapey's avatar

@Friedrich qr code is just an alias for a url. If you cannot type the url into your browser and have it connect, then it's not going to be any different if that url is presented as a qr code

1 like

Please or to participate in this conversation.