SimpleSoftwareIO / simple-qrcode

An easy-to-use PHP QrCode generator with first-party support for Laravel.
https://www.simplesoftware.io/simple-qrcode
MIT License
2.72k stars 389 forks source link

MeCard not working properly? #148

Closed Sebascc closed 4 years ago

Sebascc commented 4 years ago

I'm using Laravel to create a QR-Code with SimpleSOftwareIO. I experiance an issue when reacting a MeCard.

I expect the first snippet of code to create a MeCard. But it actually creates QR-code based on a string of the text. You could say that the software is not able to recognise it's suppose to create a MeCard instead of a regular QR-Code.

How do I approach this situation? Below is a snippets of code that should work in the laravel.blade.php view so that you can try this for yourself.

{!! \SimpleSoftwareIO\QrCode\Facades\QrCode::size(300)->generate('MECARD:Simple, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@simplesoftware.io;;') !!}

Working code example: {!! QrCode::size(100)->generate(Request::url()); !!}

Sebascc commented 4 years ago

Solved, you can generate code by using the following snippit in the Laravel blade template: {!! \SimpleSoftwareIO\QrCode\Facades\QrCode::size(400)->generate('BEGIN:VCARD VERSION:4.0 N:Gump;Forrest;;Mr.; FN:Forrest Gump ORG:Bubba Gump Shrimp Co. TITLE:Shrimp Man PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212 TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212 ADR;TYPE=WORK;PREF=1;LABEL="100 Waters Edge\nBaytown\, LA 30314\nUnited States of America":;;100 Waters Edge;Baytown;LA;30314;United States of America ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America EMAIL:forrestgump@example.com REV:20080424T195243Z x-qq:21588891 END:VCARD'); !!}