{"id":28381,"date":"2022-07-13T07:44:10","date_gmt":"2022-07-13T07:44:10","guid":{"rendered":"http:\/\/laravel-engaging-product-packaging-qr-codes"},"modified":"2022-07-13T07:44:10","modified_gmt":"2022-07-13T07:44:10","slug":"laravel-engaging-product-packaging-qr-codes","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/","title":{"rendered":"Laravel Engaging Product Packaging QR Codes"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Laravel is a PHP framework developed with developer productivity in mind. The framework also aims to evolve with the web and has already incorporated several new features and ideas in the web development world\u2014such as job queues, <strong>API authentication<\/strong> out of the box, real-time communication, and much more.<\/p>\n<p>Cloudinary is a Software-as-a-Service (SaaS) solution for managing all your web or mobile application\u2019s media assets in the cloud. Cloudinary offers an end-to-end solution for all your image and video needs, including the upload, storage, administration, transformation and optimized delivery.<\/p>\n<h2>Introduction<\/h2>\n<p>Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.<\/p>\n<p>Let\u2019s get started.<\/p>\n<h2>PHPSandbox and Github<\/h2>\n<p>The final project can be viewed on <a href=\"https:\/\/phpsandbox.io\/e\/x\/imdid?layout=EditorPreview&amp;defaultPath=%2F&amp;theme=dark&amp;showExplorer=no&amp;openedFiles=\">PHPSandbox<\/a> and the entire source code is available on my <a href=\"https:\/\/github.com\/musebe\/laravel-cloudinary-product-qrcodes\">Github<\/a> repository.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Using Cloudinary in your Laravel projects is pretty straightforward. However, for you to be able to easily follow along, you need to have a good command of your terminal, Git, and entry knowledge of PHP specifically with the Laravel framework.<\/p>\n<h2>Getting Started<\/h2>\n<p>Being that Laravel is a PHP Framework, we will need Composer. Like any modern PHP framework, Laravel uses Composer to manage its dependencies. So, before we can start ensure you have Composer installed on your machine. Follow step 1 below to install Composer and PHP.<\/p>\n<ol>\n<li>Install <a href=\"https:\/\/getcomposer.org\/\">Composer<\/a> and <a href=\"https:\/\/www.php.net\/manual\/en\/install.windows.tools.php\">PHP<\/a> on<\/li>\n<\/ol>\n<p>your development or production machine.<\/p>\n<ol start=\"2\">\n<li>\n<p>Install Laravel<\/p>\n<\/li>\n<li>\n<p>Via Composer:<\/p>\n<\/li>\n<\/ol>\n<p><code>composer create-project --prefer-dist laravel\/laravel cloudinary-video-slideshow<\/code><\/p>\n<ol start=\"2\">\n<li>Via Laravel Installer<\/li>\n<\/ol>\n<p><code>composer global require laravel\/installer<\/code><\/p>\n<p><code>laravel new cloudinary-video-slideshow<\/code><\/p>\n<ol start=\"3\">\n<li>In step 2 above we have installed the Laravel Installer and used it to scaffold a new application in the folder <code>cloudinary-video-slideshow<\/code>. With Laravel installed, we should be able to start and test the server ensuring everything is okay. Change the directory to the project folder and run the local development server by typing the following commands:<\/li>\n<\/ol>\n<p><code>cd cloudinary-video-slideshow<\/code><\/p>\n<p><code>php artisan serve<\/code><\/p>\n<p>The Laravel project is now up and running. When you open <code>http:\/\/localhost:8000<\/code> on your computer, you should see the image below:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/dgrpkngjn\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1655887283\/watermark-api\/assets\/laravel-running_zqk8ol.png\" alt=\"Laravel Server Running\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1239\" height=\"638\"\/><\/p>\n<h2>Setting up Cloudinary\u2019s Laravel SDK<\/h2>\n<p>Cloudinary has a tonne of features from media upload, storage, administration, and manipulation to optimization and delivery. In this article, we will use image transformation to create product labels with embedded QR codes.<\/p>\n<ol>\n<li>Sign up for a free Cloudinary account then navigate to the Console page and take note of your Cloud name, API Key and API Secret.<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/dgrpkngjn\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1655976836\/assets\/cloudinary_dashboard.png\" alt=\"Cloudinary Dashboard\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"940\" height=\"441\"\/><\/p>\n<ol start=\"2\">\n<li>Install <a href=\"https:\/\/github.com\/cloudinary-labs\/cloudinary-laravel#installation\">Cloudinary\u2019s Laravel SDK<\/a>:<\/li>\n<\/ol>\n<p><code>composer require cloudinary-labs\/cloudinary-laravel<\/code><\/p>\n<p><strong>Note<\/strong>: Please ensure you follow all the steps in the #Installation section. Publish the configuration file and add the Cloudinary credentials you noted in Step 1 to the <code>.env<\/code> file.<\/p>\n<pre class=\"js-syntax-highlighted\"><code>\nCLOUDINARY_API_KEY=YOUR_CLOUDINARY_API_KEY\n\nCLOUDINARY_API_SECRET=YOUR_CLOUDINARY_API_SECRET\n\nCLOUDINARY_CLOUD_NAME=YOUR_CLOUDINARY_CLOUD_NAME\n\n<\/code><\/pre>\n<h2>Product Package Details<\/h2>\n<p>We will need a UI to collect product details, for this, we will use the Laravel package Livewire to build this.<\/p>\n<ol>\n<li>Install Livewire Package by running the following command in your Laravel project:<\/li>\n<\/ol>\n<p><code>composer require livewire\/livewire<\/code><\/p>\n<ol start=\"2\">\n<li>Include Livewire scripts and styles on every page that will be using Livewire. In our case <code>welcome.blade.php<\/code>:<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">\n...\n\n@livewireStyles\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">head<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n\n...\n\n@livewireScripts\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">html<\/span>&gt;<\/span>\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<ol start=\"3\">\n<li>We will then create a Livewire Component to handle our image uploads:<\/li>\n<\/ol>\n<p><code>php artisan make:livewire ProductPackaging<\/code><\/p>\n<p>This will create two files, first<\/p>\n<p><code>app\/Http\/Livewire\/ProductPackaging.php<\/code> and the other one\nin <code>resources\/views\/livewire\/product-packaging.blade.php<\/code><\/p>\n<p>Now you can use this component anywhere in your Laravel project using the following snippet:<\/p>\n<p><code>&lt;livewire:product-packaging\/&gt;<\/code><\/p>\n<p>or<\/p>\n<p><code>@livewire('product-packaging')<\/code><\/p>\n<ol start=\"3\">\n<li>Open <code>resources\/views\/welcome.blade.php<\/code> and add the following code within the <code>&lt;body&gt;&lt;\/body&gt;<\/code> tags as shown below:<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"antialiased\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@livewire('product-packaging')\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This includes the Livewire component we created earlier in our <code>welcome.blade.php<\/code>.<\/p>\n<p><strong>Note:<\/strong> Please ensure you go through the <a href=\"https:\/\/laravel-livewire.com\/docs\/2.x\/quickstart\">Livewire documentation<\/a>, to learn how to install and set it up.<\/p>\n<ol start=\"3\">\n<li>Open the file <code>resources\/views\/livewire\/product-packaging.blade.php<\/code> and populate it with the following code:<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">form<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"mb-5\"<\/span>  <span class=\"hljs-attr\">wire:submit.prevent<\/span>=<span class=\"hljs-string\">\"store\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-group row mt-3 mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"package\"<\/span>  <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"file\"<\/span>  <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control @error('package') is-invalid @enderror\"<\/span>\n\n<span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Choose files...\"<\/span>  <span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"package\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\">\"package\"<\/span>&gt;<\/span>\n\nUpload Product Packaging...\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n\n@error('package')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-5\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\">\"location\"<\/span>&gt;<\/span>QRCode Position<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">select<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"location\"<\/span>  <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"file\"<\/span>  <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-select @error('location') is-invalid @enderror\"<\/span>\n\n<span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"location\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">selected<\/span>&gt;<\/span>Select Position ...<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">selected<\/span>  <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"north_east\"<\/span>&gt;<\/span>Top Right<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"north_west\"<\/span>&gt;<\/span>Top Left<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"south_east\"<\/span>&gt;<\/span>Bottom Right<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"south_west\"<\/span>&gt;<\/span>Bottom Left<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"center\"<\/span>&gt;<\/span>Center<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">select<\/span>&gt;<\/span>\n\n@error('location')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>&gt;<\/span>Name<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control @error('name') is-invalid @enderror\"<\/span>  <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Product Name\"<\/span>\n\n<span class=\"hljs-attr\">aria-label<\/span>=<span class=\"hljs-string\">\"Product Name\"<\/span>\n\n<span class=\"hljs-attr\">aria-describedby<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>  <span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"name\"<\/span>&gt;<\/span>\n\n@error('name')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>&gt;<\/span>Price<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"number\"<\/span>  <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control @error('price') is-invalid @enderror\"<\/span>  <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Product Price\"<\/span>\n\n<span class=\"hljs-attr\">aria-label<\/span>=<span class=\"hljs-string\">\"Product Price\"<\/span>\n\n<span class=\"hljs-attr\">aria-describedby<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>  <span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"price\"<\/span>&gt;<\/span>\n\n@error('price')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>&gt;<\/span>Short Desc<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span>  <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control @error('short_desc') is-invalid @enderror\"<\/span>\n\n<span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Product Short Desc\"<\/span>\n\n<span class=\"hljs-attr\">aria-label<\/span>=<span class=\"hljs-string\">\"Product Short Desc\"<\/span>\n\n<span class=\"hljs-attr\">aria-describedby<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>  <span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"short_desc\"<\/span>&gt;<\/span>\n\n@error('short_desc')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group mb-3\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"input-group-text\"<\/span>  <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>&gt;<\/span>Desc<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">textarea<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"form-control @error('desc') is-invalid @enderror\"<\/span>  <span class=\"hljs-attr\">placeholder<\/span>=<span class=\"hljs-string\">\"Product Desc\"<\/span>\n\n<span class=\"hljs-attr\">aria-label<\/span>=<span class=\"hljs-string\">\"Product Desc\"<\/span>\n\n<span class=\"hljs-attr\">aria-describedby<\/span>=<span class=\"hljs-string\">\"basic-addon1\"<\/span>  <span class=\"hljs-attr\">wire:model<\/span>=<span class=\"hljs-string\">\"desc\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">textarea<\/span>&gt;<\/span>\n\n@error('desc')\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"invalid-feedback\"<\/span>&gt;<\/span>{{ $message }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n@enderror\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">small<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"text-muted text-center mt-2\"<\/span>  <span class=\"hljs-attr\">wire:loading<\/span>  <span class=\"hljs-attr\">wire:target<\/span>=<span class=\"hljs-string\">\"package\"<\/span>&gt;<\/span>\n\n{{ __('Uploading') }}\u2026\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">small<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"text-center\"<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"submit\"<\/span>  <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn btn-sm btn-primary\"<\/span>&gt;<\/span>\n\n{{ __('Create New Product') }}\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"spinner-border spinner-border-sm ml-1 mt-1\"<\/span>  <span class=\"hljs-attr\">wire:loading<\/span>  <span class=\"hljs-attr\">wire:target<\/span>=<span class=\"hljs-string\">\"store\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">i<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">form<\/span>&gt;<\/span>\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This is our Livewire Component view, this basically will display a form with a couple of input fields and a button. You will see the implementation in code shortly.<\/p>\n<h2>Install QR Code Package<\/h2>\n<p>In practice, QR codes often contain data for a locator, identifier, or tracker that points to a website or application.<\/p>\n<p>We will use the <code>simplesoftwareio\/simple-qrcode<\/code> package to create the QR Codes that we will embed on our product labels.<\/p>\n<p><code>composer require simplesoftwareio\/simple-qrcode<\/code><\/p>\n<h2>SQLite Database<\/h2>\n<p>Laravel makes interacting with databases extremely simple across a variety of supported databases using raw SQL. We will save our product details in the SQLite database. This is suitable for a small applications.<\/p>\n<ol>\n<li>\n<p>Edit your <code>.env<\/code> file and change <code>DB_CONNECTION<\/code> to <code>sqlite<\/code><\/p>\n<\/li>\n<li>\n<p>Open your <code>config\/database.php<\/code> file and change the default to sqlite:<\/p>\n<\/li>\n<\/ol>\n<p><code>'default' =&gt; env('DB_CONNECTION', 'sqlite'),<\/code><\/p>\n<ol start=\"3\">\n<li>In the connections array, change sqlite\u2019s database key-value pair as shown below and leave the rest as is:<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n<span class=\"hljs-string\">'connections'<\/span>  =&gt;  &#91;\n\n<span class=\"hljs-string\">'sqlite'<\/span>  =&gt;  &#91;\n\n<span class=\"hljs-string\">'driver'<\/span>  =&gt;  <span class=\"hljs-string\">'sqlite'<\/span>,\n\n<span class=\"hljs-string\">'url'<\/span>  =&gt;  env(<span class=\"hljs-string\">'DATABASE_URL'<\/span>),\n\n<span class=\"hljs-string\">'database'<\/span>  =&gt;  database_path(<span class=\"hljs-string\">'database.sqlite'<\/span>),\n\n<span class=\"hljs-string\">'prefix'<\/span>  =&gt;  <span class=\"hljs-string\">''<\/span>,\n\n<span class=\"hljs-string\">'foreign_key_constraints'<\/span>  =&gt;  env(<span class=\"hljs-string\">'DB_FOREIGN_KEYS'<\/span>,  <span class=\"hljs-keyword\">true<\/span>),\n\n],\n\n...\n\n];\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Run the command <code>php artisan migrate:status<\/code> to test if you are connected, you should see the response <code>Migration table not found<\/code>.<\/p>\n<ol start=\"4\">\n<li>Next, we need to create the Product model. Run the command<\/li>\n<\/ol>\n<p><code>php artisan make:model Product<\/code><\/p>\n<p>This will create the file <code>app\\Models\\Product.php<\/code>. Open the file and add the following:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n<span class=\"hljs-keyword\">protected<\/span>  $fillable  =  &#91;\n\n<span class=\"hljs-string\">'name'<\/span>,\n\n<span class=\"hljs-string\">'price'<\/span>,\n\n<span class=\"hljs-string\">'short_desc'<\/span>,\n\n<span class=\"hljs-string\">'desc'<\/span>,\n\n<span class=\"hljs-string\">'package'<\/span>\n\n];\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<ol start=\"5\">\n<li>Lastly, we will create the <code>create_products_table<\/code> migration:<\/li>\n<\/ol>\n<p><code>php artisan make:migration create_products_table<\/code><\/p>\n<p>Open the file created at <code>database\\migrations\\&lt;timestamp&gt;_create_products_table.php<\/code> and in the <code>up<\/code> method and the following code under <code>Schema:create<\/code>:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n$table-&gt;id();\n\n$table-&gt;string(<span class=\"hljs-string\">'name'<\/span>);\n\n$table-&gt;float(<span class=\"hljs-string\">'price'<\/span>);\n\n$table-&gt;string(<span class=\"hljs-string\">'short_desc'<\/span>);\n\n$table-&gt;longText(<span class=\"hljs-string\">'desc'<\/span>);\n\n$table-&gt;string(<span class=\"hljs-string\">'package'<\/span>);  <span class=\"hljs-comment\">\/\/will store URL of package<\/span>\n\n$table-&gt;timestamps();\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Once done run the command <code>php artisan migrate<\/code>, this will create the products table with the above columns.<\/p>\n<h2>Implementing the QR Code<\/h2>\n<p>Open the file <code>app\/Http\/Livewire\/ProductPackaging.php<\/code>. Here, we are going to add a method that will handle the video selected by the user, and upload them to Cloudinary for video moderation.<\/p>\n<p>Add the following code to this file.<\/p>\n<ol>\n<li>First, we use Livewires <code>WithFileUploads<\/code> to help us with file uploads, then create the variables as shown.<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n<span class=\"hljs-keyword\">use<\/span>  <span class=\"hljs-title\">Livewire<\/span>\\<span class=\"hljs-title\">WithFileUploads<\/span>;\n\n<span class=\"hljs-keyword\">public<\/span>  $package;\n\n<span class=\"hljs-keyword\">public<\/span>  $name;\n\n<span class=\"hljs-keyword\">public<\/span>  $price;\n\n<span class=\"hljs-keyword\">public<\/span>  $short_desc;\n\n<span class=\"hljs-keyword\">public<\/span>  $desc;\n\n<span class=\"hljs-keyword\">public<\/span>  $location;\n\n<span class=\"hljs-keyword\">public<\/span>  $qrCodeId;\n\n<span class=\"hljs-keyword\">public<\/span>  $product;\n\n...\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<ol start=\"2\">\n<li>Secondly, we will create the <code>store<\/code> method which will process the creation of the product label. First by creating the QR code, uploading it to <a href=\"https:\/\/cloudinary.com\">Cloudinary<\/a>, then creating an image overlay.<\/li>\n<\/ol>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n<span class=\"hljs-keyword\">public<\/span>  <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>  <span class=\"hljs-title\">store<\/span><span class=\"hljs-params\">()<\/span>  <\/span>{\n\n...\n\n}\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<ol start=\"3\">\n<li>Let\u2019s see how this works:<\/li>\n<\/ol>\n<ul>\n<li>Creating the QR code &#8211; we create the QR code from the product description submitted by the user and store it as <code>product_qr_code.svg<\/code> under the <code>storage<\/code> folder.<\/li>\n<\/ul>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n...\n\n$qrCodeData  =  <span class=\"hljs-keyword\">$this<\/span>-&gt;desc;\n\n$qrCodePath  =  <span class=\"hljs-string\">'..\/storage\/product_qr_code.svg'<\/span>;\n\nQrCode::format(<span class=\"hljs-string\">'svg'<\/span>)-&gt;size(<span class=\"hljs-number\">512<\/span>)-&gt;style(<span class=\"hljs-string\">'round'<\/span>)-&gt;backgroundColor(<span class=\"hljs-number\">255<\/span>,  <span class=\"hljs-number\">255<\/span>,  <span class=\"hljs-number\">255<\/span>,  <span class=\"hljs-number\">0<\/span>)-&gt;color(<span class=\"hljs-number\">0<\/span>,  <span class=\"hljs-number\">0<\/span>,  <span class=\"hljs-number\">0<\/span>,  <span class=\"hljs-number\">90<\/span>)-&gt;margin(<span class=\"hljs-number\">5<\/span>)-&gt;generate($qrCodeData,  $qrCodePath);\n\n...\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>We won\u2019t go to detail about how this package works, but you can reference the QR code package documentation <a href=\"https:\/\/www.simplesoftware.io\/#\/docs\/simple-qrcode\">here<\/a> for more info on the numerous features it has.<\/p>\n<ul>\n<li>Uploading the QR Code to Cloudinary &#8211; a simple upload of the QR code to Cloudinary. We are creating the <code>public_id<\/code> dynamically so we have unique ids for different products that we can reference later.<\/li>\n<\/ul>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n...\n\n<span class=\"hljs-keyword\">$this<\/span>-&gt;qrCodeId  =  cloudinary()-&gt;upload($qrCodePath,  &#91;\n\n<span class=\"hljs-string\">'folder'<\/span>  =&gt;  <span class=\"hljs-string\">'product-qrcodes'<\/span>,\n\n<span class=\"hljs-string\">'public_id'<\/span>  =&gt;  Str::uuid()-&gt;toString(),\n\n])-&gt;getPublicId();\n\n...\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<ul>\n<li>Embed the QR code &#8211; we embed the QR code created on the product packaging labels and save the details in our SQLite database:<\/li>\n<\/ul>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-wrap-lines\">\n...\n\n$packaged  =  cloudinary()-&gt;upload(<span class=\"hljs-keyword\">$this<\/span>-&gt;package-&gt;getRealPath(),  &#91;\n\n<span class=\"hljs-string\">'folder'<\/span>  =&gt;  <span class=\"hljs-string\">'product-qrcodes'<\/span>,\n\n<span class=\"hljs-string\">'transformation'<\/span>  =&gt;  &#91;\n\n<span class=\"hljs-string\">'overlay'<\/span>  =&gt;  <span class=\"hljs-keyword\">$this<\/span>-&gt;qrCodeId,\n\n<span class=\"hljs-string\">'gravity'<\/span>  =&gt;  <span class=\"hljs-keyword\">$this<\/span>-&gt;location,\n\n<span class=\"hljs-string\">'x'<\/span>  =&gt;  <span class=\"hljs-number\">0.02<\/span>,\n\n<span class=\"hljs-string\">'y'<\/span>  =&gt;  <span class=\"hljs-number\">0.02<\/span>,\n\n<span class=\"hljs-string\">'crop'<\/span>  =&gt;  <span class=\"hljs-string\">'scale'<\/span>,\n\n<span class=\"hljs-string\">'flags'<\/span>  =&gt;  <span class=\"hljs-string\">'relative'<\/span>,\n\n<span class=\"hljs-string\">'width'<\/span>  =&gt;  <span class=\"hljs-number\">0.15<\/span>,\n\n<span class=\"hljs-string\">'opacity'<\/span>  =&gt;  <span class=\"hljs-number\">80<\/span>\n\n],\n\n])-&gt;getSecurePath();\n\n$data&#91;<span class=\"hljs-string\">'package'<\/span>]  =  $packaged;\n\n<span class=\"hljs-keyword\">$this<\/span>-&gt;product  =  Product::create($data);\n\n$productName  =  <span class=\"hljs-keyword\">$this<\/span>-&gt;product-&gt;name;\n\n...\n\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The code above uses <code>overlay<\/code>, <code>gravity<\/code> &#8211; we get this as an input from the user, <code>flags<\/code> &#8211; ensures that the overlay is resized based on the resolution of the underlying layer and lastly the <code>opacity<\/code> transformation.<\/p>\n<p>The code above will be implemented within the <code>store<\/code> method, which will perform validation, create the QR then upload the images to Cloudinary to create the final product label.<\/p>\n<p>On successful implementation, you should be able to see the following when you navigate to <code>http:\/\/localhost:8000<\/code>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/dgrpkngjn\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1656851910\/product-qrcodes\/assets\/cloudinary_product_labels_sdnzca.png\" alt=\"Cloudinary Product Packaging\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1350\" height=\"820\"\/><\/p>\n<p>On successful submission, you should see the product label created with a QR code.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/dgrpkngjn\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1656851716\/product-qrcodes\/assets\/cloudinary_product_qrcode_f2k5pt.png\" alt=\"Cloudinary Product Packaging Success\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"1350\" height=\"1542\"\/><\/p>\n<p>When you scan this code with your phone it will provide you with detailed product information as shown:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/dgrpkngjn\/image\/upload\/c_limit,w_2000\/f_auto\/q_auto\/v1656851696\/product-qrcodes\/assets\/cloudinary_qrcode_scan_jzgdsc.jpg\" alt=\"Cloudinary QR Code Scan\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"720\" height=\"1467\"\/><\/p>\n<h2>Conclusion<\/h2>\n<p>A QR code is a type of matrix barcode invented in 1994 by the Japanese automotive company Denso Wave. A barcode is a machine-readable optical label that can contain information about the item to which it is attached.<\/p>\n<p>There are multiple use cases for QR codes, but the most vital use has been in manufacturing and in retail where QR code labels are used to provide detailed information on shipping and retail products as well.<\/p>\n<p>Using Cloudinary we have been able to create product packaging labels that are engaging, providing shoppers with more details about their purchases. Check out Cloudinary for your A to Z media management &#8211; upload, storage, administration, manipulation, optimization and delivery.<\/p>\n<p><a href=\"https:\/\/cloudinary.com\/signup\">Get started<\/a> with Cloudinary in your Laravel projects for FREE!<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":28382,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[134,370,387,229,371],"class_list":["post-28381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-guest-post","tag-image","tag-laravel","tag-php","tag-under-review"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Laravel Engaging Product Packaging QR Codes<\/title>\n<meta name=\"description\" content=\"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Laravel Engaging Product Packaging QR Codes\" \/>\n<meta property=\"og:description\" content=\"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-13T07:44:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"708\" \/>\n\t<meta property=\"og:image:height\" content=\"354\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"Laravel Engaging Product Packaging QR Codes\",\"datePublished\":\"2022-07-13T07:44:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\"},\"wordCount\":6,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA\",\"keywords\":[\"Guest Post\",\"Image\",\"Laravel\",\"PHP\",\"Under Review\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\",\"name\":\"Laravel Engaging Product Packaging QR Codes\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA\",\"datePublished\":\"2022-07-13T07:44:10+00:00\",\"description\":\"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA\",\"width\":708,\"height\":354},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Laravel Engaging Product Packaging QR Codes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Laravel Engaging Product Packaging QR Codes","description":"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/","og_locale":"en_US","og_type":"article","og_title":"Laravel Engaging Product Packaging QR Codes","og_description":"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-07-13T07:44:10+00:00","og_image":[{"width":708,"height":354,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/"},"author":{"name":"","@id":""},"headline":"Laravel Engaging Product Packaging QR Codes","datePublished":"2022-07-13T07:44:10+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/"},"wordCount":6,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","keywords":["Guest Post","Image","Laravel","PHP","Under Review"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/","name":"Laravel Engaging Product Packaging QR Codes","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","datePublished":"2022-07-13T07:44:10+00:00","description":"Product Packaging is the first thing a customer sees when looking at a product. In this article, we will use Cloudinary to create engaging and compelling product packaging embedded with QR codes that will provide additional product details.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","width":708,"height":354},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/laravel-engaging-product-packaging-qr-codes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Laravel Engaging Product Packaging QR Codes"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924642\/Web_Assets\/blog\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e\/335ca2905add79bf32fd39b6d6452407034068e8-708x354-1_28382cc22e.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=28381"}],"version-history":[{"count":0,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28381\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/28382"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=28381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=28381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=28381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}