{"id":9627,"date":"2021-03-08T11:00:01","date_gmt":"2021-03-08T02:00:01","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=9627"},"modified":"2021-03-05T20:14:23","modified_gmt":"2021-03-05T11:14:23","slug":"laravel-qr-code-generator","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/9627","title":{"rendered":"Laravel QR code generator"},"content":{"rendered":"\n<p>I am using a laravel library called `simple-qr-code` in my previous project. It is pretty easy to use and configurable and I would like to share with you today.<\/p>\n\n\n\n<p>Firstly download the package via composer<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require simplesoftwareio\/simple-qrcode \"~4\"<\/code><\/pre>\n\n\n\n<p>That is all for the configuration. And you can now generate in controller like this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use SimpleSoftwareIO\\QrCode\\Facades\\QrCode;\n\nQrCode::generate('Make me into a QrCode!');<\/code><\/pre>\n\n\n\n<p>This will make a QrCode that says &#8220;Make me into a QrCode!&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/raw.githubusercontent.com\/SimpleSoftwareIO\/simple-qrcode\/master\/docs\/imgs\/make-me-into-a-qrcode.png?raw=true\" alt=\"Example QrCode\"\/><\/figure>\n\n\n\n<p>If you want to generate directly on the view, it is fine too.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{!! QrCode::size(300)->generate('generate Qr code'); !!}<\/code><\/pre>\n\n\n\n<p>If we want to generate a URL after reading the Qr code, we just have to pass a url string in generate function like this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{!! QrCode::size(300)->generate('www.google.com'); !!}<\/code><\/pre>\n\n\n\n<p>You can vary the Qr code designs as well. You can see more detail <a href=\"https:\/\/github.com\/SimpleSoftwareIO\/simple-qrcode\">here<\/a>. Make sure to use when you have to deal with qr code as it is pretty easy to use.<\/p>\n\n\n\n<p>By Yuuma<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/9627\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/9627\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Laravel QR code generator\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/9627\" data-text=\"Laravel QR code generator\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/9627\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/9627\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>I am using a laravel library called `simple-qr-code` in my previous project. It is pretty easy to use and conf [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/9627"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=9627"}],"version-history":[{"count":3,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/9627\/revisions"}],"predecessor-version":[{"id":9631,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/9627\/revisions\/9631"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=9627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=9627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=9627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}