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

eliekhazzaka's avatar

QR Code

guys i am using the package of QR code how can I enter a message in the QR code \QrCode::size(300)->backgroundColor(255,255,0)->generate('A simple QR code');

i tried to write it this way $details = \QRCode::text($body)->setOutfile($file)->png(); they told me to install imagic and i don;t want imagic please any help?

0 likes
15 replies
Sinnbeck's avatar

the package of QR code

What package? And why dont you want to install imagick?

eliekhazzaka's avatar

@Sinnbeck i used this package composer require simplesoftwareio/simple-qrcode I don't want to use it because I tried it on Laravel 8 and worked and now I'm using it on Laravel 7

Sinnbeck's avatar

@eliekhazzaka the package does not expect a certain version of laravel, so it should work the same for both versions.

But how did it work in laravel 8 and with what code?

eliekhazzaka's avatar

@Sinnbeck it was working with that work

  $body = '';
        $file = public_path('qr/qr.png' );
        $details = [
            'title'=>"fhfg",
            'body'=>'fghfgh',
           $body = 'fghfghf',
//            'qrCode'=>QrCode::size(500)
//                ->format('svg')
//                ->generate($body)
        'qrCode'=> \QRCode::text($body)->setOutfile($file)->png()
        ];
Sinnbeck's avatar

@eliekhazzaka Ok so you used imagick for that I assume. It says its needed in the docs..

You must install the imagick PHP extension if you plan on using the png image format.

But now you dont want to use it anymore?

tykus's avatar

they told me to install imagic and i don;t want imagic

If you don't want to install imagick; then you will need to find a different package which does not have imagick as a dependency!

tykus's avatar

@eliekhazzaka no. But if you want to perform some image generation and manipulation, then you need some library like Imagick / GD etc. to do that!

Sinnbeck's avatar

@eliekhazzaka Tiny documentation and it havent been updated for years. And it uses GD like the package I suggested. :)

Please or to participate in this conversation.