From a5ea6feb08e2b458783a65698d7c7d4bcbffc798 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:24:28 +0800 Subject: [PATCH 01/29] Update README.md --- README.md | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 01bbbd7..92fe509 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Simple QrCode +Easy QRCode ======================== ![Unit Tests](https://github.com/SimpleSoftwareIO/simple-qrcode/workflows/Unit%20Tests/badge.svg) @@ -7,35 +7,17 @@ Simple QrCode [![License](https://poser.pugx.org/simplesoftwareio/simple-qrcode/license.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) [![Total Downloads](https://poser.pugx.org/simplesoftwareio/simple-qrcode/downloads.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) -## [Deutsch](https://www.simplesoftware.io/#/docs/simple-qrcode/de) | [Español](https://www.simplesoftware.io/#/docs/simple-qrcode/es) | [Français](https://www.simplesoftware.io/#/docs/simple-qrcode/fr) | [Italiano](https://www.simplesoftware.io/#/docs/simple-qrcode/it) | [Português](https://www.simplesoftware.io/#/docs/simple-qrcode/pt-br) | [Русский](https://www.simplesoftware.io/#/docs/simple-qrcode/ru) | [日本語](https://www.simplesoftware.io/#/docs/simple-qrcode/ja) | [한국어](https://www.simplesoftware.io/#/docs/simple-qrcode/kr) | [हिंदी](https://www.simplesoftware.io/#/docs/simple-qrcode/hi) | [简体中文](https://www.simplesoftware.io/#/docs/simple-qrcode/zh-cn) | [العربية](https://www.simplesoftware.io/#/docs/simple-qrcode/ar) - -Language files are currently out of date. We need volunteers to upgrade them to v4! Please submit a PR request! - ## Introduction -Simple QrCode is an easy to use wrapper for the popular Laravel framework based on the great work provided by [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users. +Simple QrCode is an easy to use wrapper for the popular Laravel framework based on [Simple-QrCode](https://github.com/SimpleSoftwareIO/simple-qrcode) which is a wrapper on [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users. Now with better documentation on how to use it's functionality. -## Official Documentation +## Installation -Documentation for Simple QrCode can be found on our [website.](http://www.simplesoftware.io/#/docs/simple-qrcode) +## How to Use ## Examples ![Example 1](docs/imgs/example-1.png) ![Example 2](docs/imgs/example-2.png) -## Use Cases -

- - - -

-

- Platform to sell tickets online -

- -## Contributing - -Please submit all issues and pull requests to the [simplesoftwareio/simple-qrcode](https://github.com/simplesoftwareio/simple-qrcode) repository on the develop branch! - ## License This software is released under the [MIT license.](https://opensource.org/licenses/MIT) From a086063c5bf39a03c5fbdf5336bbce30ecde6c21 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:28:55 +0800 Subject: [PATCH 02/29] Update composer.json --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 8594a91..7b75d6a 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { - "name": "simplesoftwareio/simple-qrcode", - "description": "Simple QrCode is a QR code generator made for Laravel.", - "keywords": ["qrcode", "laravel", "simple", "generator", "wrapper"], - "homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode", + "name": "billyljren/easy-qrcode", + "description": "Easy QRCode is a QR code generator made for Laravel.", + "keywords": ["qrcode", "laravel", "easy", "svg", "png", "simple", "bacon", "generator", "wrapper"], + "homepage": "https://github.com/billyljren/easy-qrcode", "license" : "MIT", "authors": [ { - "name": "Simple Software LLC", - "email": "support@simplesoftware.io" + "name": "Beacon Systems Sdn Bhd", + "email": "info@beaconsbay.com" } ], "require": { @@ -25,7 +25,7 @@ }, "autoload": { "psr-4": { - "SimpleSoftwareIO\\QrCode\\": "src" + "BeaconsBay\\QrCode\\": "src" } }, "scripts": { @@ -34,10 +34,10 @@ "extra": { "laravel": { "providers": [ - "SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider" + "BeaconsBay\\QrCode\\QrCodeServiceProvider" ], "aliases": { - "QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode" + "QrCode": "BeaconsBay\\QrCode\\Facades\\QrCode" } } } From 87818b2548cd8911fcfcdb73de3e40da6ed065a2 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:30:16 +0800 Subject: [PATCH 03/29] Update Generator.php --- src/Generator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator.php b/src/Generator.php index 4ada416..e27d167 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:30:25 +0800 Subject: [PATCH 04/29] Update Image.php --- src/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Image.php b/src/Image.php index 02bd83c..ae2d63b 100644 --- a/src/Image.php +++ b/src/Image.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:30:40 +0800 Subject: [PATCH 05/29] Update ImageMerge.php --- src/ImageMerge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageMerge.php b/src/ImageMerge.php index f83e35d..7e941ea 100644 --- a/src/ImageMerge.php +++ b/src/ImageMerge.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:30:50 +0800 Subject: [PATCH 06/29] Update QrCodeServiceProvider.php --- src/QrCodeServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QrCodeServiceProvider.php b/src/QrCodeServiceProvider.php index da37eb9..ff6eefe 100644 --- a/src/QrCodeServiceProvider.php +++ b/src/QrCodeServiceProvider.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:31:01 +0800 Subject: [PATCH 07/29] Update QrCode.php --- src/Facades/QrCode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Facades/QrCode.php b/src/Facades/QrCode.php index 5207752..bbb9ae8 100644 --- a/src/Facades/QrCode.php +++ b/src/Facades/QrCode.php @@ -1,9 +1,9 @@ Date: Fri, 15 Mar 2024 15:31:13 +0800 Subject: [PATCH 08/29] Update BTC.php --- src/DataTypes/BTC.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/BTC.php b/src/DataTypes/BTC.php index fa55d81..6575134 100644 --- a/src/DataTypes/BTC.php +++ b/src/DataTypes/BTC.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:31:24 +0800 Subject: [PATCH 09/29] Update DataTypeInterface.php --- src/DataTypes/DataTypeInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/DataTypeInterface.php b/src/DataTypes/DataTypeInterface.php index cd52c90..31e2304 100644 --- a/src/DataTypes/DataTypeInterface.php +++ b/src/DataTypes/DataTypeInterface.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:31:34 +0800 Subject: [PATCH 10/29] Update Email.php --- src/DataTypes/Email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/Email.php b/src/DataTypes/Email.php index 37d4aca..546c65e 100644 --- a/src/DataTypes/Email.php +++ b/src/DataTypes/Email.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:31:44 +0800 Subject: [PATCH 11/29] Update Geo.php --- src/DataTypes/Geo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/Geo.php b/src/DataTypes/Geo.php index d51a36d..592c612 100644 --- a/src/DataTypes/Geo.php +++ b/src/DataTypes/Geo.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:31:52 +0800 Subject: [PATCH 12/29] Update PhoneNumber.php --- src/DataTypes/PhoneNumber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/PhoneNumber.php b/src/DataTypes/PhoneNumber.php index ad27bdf..2a99d87 100644 --- a/src/DataTypes/PhoneNumber.php +++ b/src/DataTypes/PhoneNumber.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:32:00 +0800 Subject: [PATCH 13/29] Update SMS.php --- src/DataTypes/SMS.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/SMS.php b/src/DataTypes/SMS.php index 8f766be..467ea30 100644 --- a/src/DataTypes/SMS.php +++ b/src/DataTypes/SMS.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:32:10 +0800 Subject: [PATCH 14/29] Update WiFi.php --- src/DataTypes/WiFi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes/WiFi.php b/src/DataTypes/WiFi.php index bb98cb4..311fa68 100644 --- a/src/DataTypes/WiFi.php +++ b/src/DataTypes/WiFi.php @@ -1,6 +1,6 @@ Date: Fri, 15 Mar 2024 15:32:28 +0800 Subject: [PATCH 15/29] Update GeneratorTest.php --- tests/GeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index d0d75be..13ad1f3 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -11,7 +11,7 @@ use BaconQrCode\Renderer\RendererStyle\Gradient; use BaconQrCode\Renderer\RendererStyle\RendererStyle; use PHPUnit\Framework\TestCase; -use SimpleSoftwareIO\QrCode\Generator; +use BeaconsBay\QrCode\Generator; class GeneratorTest extends TestCase { From a8e593082f8f58ce708fb6085227c749bbce1b36 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:32:42 +0800 Subject: [PATCH 16/29] Update ImageMergeTest.php --- tests/ImageMergeTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ImageMergeTest.php b/tests/ImageMergeTest.php index c1af0f0..4036fe5 100644 --- a/tests/ImageMergeTest.php +++ b/tests/ImageMergeTest.php @@ -1,8 +1,8 @@ Date: Fri, 15 Mar 2024 15:32:51 +0800 Subject: [PATCH 17/29] Update ImageTest.php --- tests/ImageTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ImageTest.php b/tests/ImageTest.php index f242979..606c104 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:05 +0800 Subject: [PATCH 18/29] Update BTCTest.php --- tests/DataTypes/BTCTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/BTCTest.php b/tests/DataTypes/BTCTest.php index 04b3e49..92d6f42 100644 --- a/tests/DataTypes/BTCTest.php +++ b/tests/DataTypes/BTCTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:12 +0800 Subject: [PATCH 19/29] Update EmailTest.php --- tests/DataTypes/EmailTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/EmailTest.php b/tests/DataTypes/EmailTest.php index 17a6931..d57afcd 100644 --- a/tests/DataTypes/EmailTest.php +++ b/tests/DataTypes/EmailTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:19 +0800 Subject: [PATCH 20/29] Update GeoTest.php --- tests/DataTypes/GeoTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/GeoTest.php b/tests/DataTypes/GeoTest.php index 3ec4b7e..84e44a4 100644 --- a/tests/DataTypes/GeoTest.php +++ b/tests/DataTypes/GeoTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:30 +0800 Subject: [PATCH 21/29] Update PhoneNumberTest.php --- tests/DataTypes/PhoneNumberTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/PhoneNumberTest.php b/tests/DataTypes/PhoneNumberTest.php index a3a7b8b..d2e6615 100644 --- a/tests/DataTypes/PhoneNumberTest.php +++ b/tests/DataTypes/PhoneNumberTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:36 +0800 Subject: [PATCH 22/29] Update SMSTest.php --- tests/DataTypes/SMSTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/SMSTest.php b/tests/DataTypes/SMSTest.php index 42a6e43..6375639 100644 --- a/tests/DataTypes/SMSTest.php +++ b/tests/DataTypes/SMSTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:33:44 +0800 Subject: [PATCH 23/29] Update WiFiTest.php --- tests/DataTypes/WiFiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DataTypes/WiFiTest.php b/tests/DataTypes/WiFiTest.php index 246e1bf..4c1d237 100644 --- a/tests/DataTypes/WiFiTest.php +++ b/tests/DataTypes/WiFiTest.php @@ -1,7 +1,7 @@ Date: Fri, 15 Mar 2024 15:34:29 +0800 Subject: [PATCH 24/29] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00ea4ff..7331da1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contribution Guidelines -Please submit all issues and pull requests to the [simplesoftwareio/simple-qrcode](https://github.com/simplesoftwareio/simple-qrcode) repository on the develop branch! \ No newline at end of file +Please submit all issues and pull requests to the [billyljren/easy-qrcode](https://github.com/billyljren/easy-qrcode) repository on the develop branch! From 65e5ee85aaf0474b815cf974acbe0bf311c439b6 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:34:54 +0800 Subject: [PATCH 25/29] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 5a20219..9b31b29 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2020 Simple Software LLC www.simplesoftware.io +Copyright (c) 2014-2020 Beacon Systems Sdn Bhd www.beaconsbay.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From e690b02fb69384a684c92cb53bec074640bdb942 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:35:47 +0800 Subject: [PATCH 26/29] Update SECURITY.md --- SECURITY.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 2a3758d..3fe6d79 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,11 +4,8 @@ | Version | Supported | | ------- | ------------------ | -| >= 2.x | :white_check_mark: | -| <= 1.x | :x: | +| >= 1.x | :white_check_mark: | ## Reporting a Vulnerability -Please report security vulnerabilities responsibility by emailing `security@simplesoftware.io.` - -We will fix the vulnerability privately, push a new release, and then go public with the notification. +Please raise an any issues within GitHub From 996daa9a6580cb95b1c844ebb31906d8eacbc2c7 Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:41:22 +0800 Subject: [PATCH 27/29] Update README.md --- docs/en/README.md | 55 ++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/docs/en/README.md b/docs/en/README.md index 4df2d3c..c77cd64 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -1,56 +1,28 @@ -[![Build Status](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode.svg?branch=master)](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode) [![Latest Stable Version](https://poser.pugx.org/simplesoftwareio/simple-qrcode/v/stable.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) [![Latest Unstable Version](https://poser.pugx.org/simplesoftwareio/simple-qrcode/v/unstable.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) [![License](https://poser.pugx.org/simplesoftwareio/simple-qrcode/license.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) [![Total Downloads](https://poser.pugx.org/simplesoftwareio/simple-qrcode/downloads.svg)](https://packagist.org/packages/simplesoftwareio/simple-qrcode) - -#### [Deutsch](http://www.simplesoftware.io/#/docs/simple-qrcode/de) | [Español](http://www.simplesoftware.io/#/docs/simple-qrcode/es) | [Français](http://www.simplesoftware.io/#/docs/simple-qrcode/fr) | [Italiano](http://www.simplesoftware.io/#/docs/simple-qrcode/it) | [Português](http://www.simplesoftware.io/#/docs/simple-qrcode/pt-br) | [Русский](http://www.simplesoftware.io/#/docs/simple-qrcode/ru) | [日本語](http://www.simplesoftware.io/#/docs/simple-qrcode/ja) | [한국어](http://www.simplesoftware.io/#/docs/simple-qrcode/kr) | [हिंदी](http://www.simplesoftware.io/#/docs/simple-qrcode/hi) | [简体中文](http://www.simplesoftware.io/#/docs/simple-qrcode/zh-cn) - -## Try our dead simple, free file transfer service [keep.sh](https://keep.sh) - -[![keep.sh](https://user-images.githubusercontent.com/624784/95805291-1121e980-0cd3-11eb-9048-0264bd9f2fd7.gif)](https://keep.sh) - -Upload files with a single curl command from your terminal! `curl --upload-file file.txt https://keep.sh` - -## Use Cases -

- - - -

-

- Platform to sell tickets online -

- ## Introduction -Simple QrCode is an easy to use wrapper for the popular Laravel framework based on the great work provided by [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users. +Easy QrCode is an easy to use wrapper for the popular Laravel framework based on the great work provided by [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users. ![Example 1](https://raw.githubusercontent.com/SimpleSoftwareIO/simple-qrcode/master/docs/imgs/example-1.png?raw=true) ![Example 2](https://raw.githubusercontent.com/SimpleSoftwareIO/simple-qrcode/master/docs/imgs/example-2.png?raw=true) -## Upgrade Guide - -Upgrade from v2 or v3 by changing your `composer.json` file to `~4` +## Requirements You **must** install the `imagick` PHP extension if you plan on using the `png` image format. #### v4 -> There was a mistake when creating 4.1.0 and allowing a backwards breaking change into the master branch. The `generate` method will now return an instance of `Illuminate\Support\HtmlString` if you are running Laravel. See https://github.com/SimpleSoftwareIO/simple-qrcode/issues/205 for more information. - -There was a Laravel facade issue within v3 that causes some loading issues. The only way to fix this was to create a backwards breaking change so v4 has been released. If you are coming from v2 there is no need to change any code. The below change only effects users on v3. - All references to the `QrCode` facade need to be changed to: ``` -use SimpleSoftwareIO\QrCode\Facades\QrCode; +use BeaconsBay\QrCode\Facades\QrCode; ``` ## Configuration -#### Composer +#### Install via Composer -Run `composer require simplesoftwareio/simple-qrcode "~4"` to add the package. - -Laravel will automatically pick up and install the package. +Run `composer require billyljren/easy-qrcode` ## Simple Ideas @@ -72,6 +44,7 @@ You may embed a qrcode inside of an e-mail to allow your users to quickly scan. + ## Usage #### Basic Usage @@ -79,12 +52,12 @@ You may embed a qrcode inside of an e-mail to allow your users to quickly scan. ``` // All examples below assume you are pulling in the QrCode facade with the following line of code. The Facade is auto-loaded for Laravel users. -use SimpleSoftwareIO\QrCode\Facades\QrCode; +use BeaconsBay\QrCode\Facades\QrCode; ``` Using the QrCode Generator is very easy. The most basic syntax is: - use SimpleSoftwareIO\QrCode\Facades\QrCode; + use BeaconsBay\QrCode\Facades\QrCode; QrCode::generate('Make me into a QrCode!'); @@ -400,20 +373,20 @@ This helpers makes scannable QrCodes that can connect a phone to a WiFi network: You can use a prefix found in the table below inside the `generate` section to create a QrCode to store more advanced information: - QrCode::generate('http://www.simplesoftware.io'); + QrCode::generate('http://www.beaconx.com.my'); | Usage | Prefix | Example | | --- | --- | --- | -| Website URL | http:// | http://www.simplesoftware.io | -| Secured URL | https:// | https://www.simplesoftware.io | -| E-mail Address | mailto: | mailto:support@simplesoftware.io | +| Website URL | http:// | http://www.beaconx..com.my | +| Secured URL | https:// | https://www.beaconx.com.my | +| E-mail Address | mailto: | mailto:support@beaconsbay.com | | Phone Number | tel: | tel:555-555-5555 | | Text (SMS) | sms: | sms:555-555-5555 | | Text (SMS) With Pretyped Message | sms: | sms::I am a pretyped message | | Text (SMS) With Pretyped Message and Number | sms: | sms:555-555-5555:I am a pretyped message | | Geo Address | geo: | geo:-78.400364,-85.916993 | -| MeCard | mecard: | MECARD:Simple, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@simplesoftware.io; | +| MeCard | mecard: | MECARD:Beacon, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@beaconsbay.com; | | VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) | | Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) | @@ -422,7 +395,7 @@ You can use a prefix found in the table below inside the `generate` section to c You may use this package outside of Laravel by instantiating a new `Generator` class. - use SimpleSoftwareIO\QrCode\Generator; + use BeaconsBay\QrCode\Generator; $qrcode = new Generator; $qrcode->size(500)->generate('Make a qrcode without Laravel!'); From 64caf9f0cb6650d6e4bae5f494a6147879e1e55f Mon Sep 17 00:00:00 2001 From: billyljren <114484318+billyljren@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:43:03 +0800 Subject: [PATCH 28/29] Update README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 92fe509..22f8a78 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,9 @@ Easy QRCode ## Introduction Simple QrCode is an easy to use wrapper for the popular Laravel framework based on [Simple-QrCode](https://github.com/SimpleSoftwareIO/simple-qrcode) which is a wrapper on [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). We created an interface that is familiar and easy to install for Laravel users. Now with better documentation on how to use it's functionality. -## Installation +## Full Documentation -## How to Use - -## Examples - -![Example 1](docs/imgs/example-1.png) ![Example 2](docs/imgs/example-2.png) +https://github.com/billyljren/easy-qrcode/blob/develop/docs/en/README.md ## License From 70368a088c8968dd92b384bd834d301292c39386 Mon Sep 17 00:00:00 2001 From: Pascal Canadas Date: Sun, 28 Apr 2024 19:53:37 +0200 Subject: [PATCH 29/29] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Generate=20SVG=20wi?= =?UTF-8?q?th=20mergesvg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #1 --- composer.json | 3 +- src/Generator.php | 6 ++ src/ImageMergeSvg.php | 163 ++++++++++++++++++++++++++++++++++++++++++ src/SVGString.php | 83 +++++++++++++++++++++ 4 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 src/ImageMergeSvg.php create mode 100644 src/SVGString.php diff --git a/composer.json b/composer.json index 7b75d6a..1a97d23 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "require": { "php": ">=7.2|^8.0", "ext-gd": "*", - "bacon/bacon-qr-code": "^2.0" + "bacon/bacon-qr-code": "^2.0", + "meyfa/php-svg": "^0.15.0" }, "require-dev": { "mockery/mockery": "~1", diff --git a/src/Generator.php b/src/Generator.php index e27d167..8275ce8 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -175,6 +175,12 @@ public function generate(string $text, string $filename = null) $qrCode = $merger->merge($this->imagePercentage); } + if ($this->imageMerge !== null && $this->format === 'svg') { + $merge = new ImageMergeSvg(new SVGString($qrCode), new SVGString($this->imageMerge)); + $qrCode = $merge->merge($this->imagePercentage); + } + + if ($filename) { file_put_contents($filename, $qrCode); diff --git a/src/ImageMergeSvg.php b/src/ImageMergeSvg.php new file mode 100644 index 0000000..3d9d1a9 --- /dev/null +++ b/src/ImageMergeSvg.php @@ -0,0 +1,163 @@ +sourceImage = $sourceImage; + $this->mergeImage = $mergeImage; + } + + /** + * Returns an QrCode that has been merge with another image. + * This is usually used with logos to imprint a logo into a QrCode. + * + * @param $percentage float The percentage of size relative to the entire QR of the merged image + * + * @return string + */ + public function merge($percentage) + { + + $this->setProperties($percentage); + /* */ + $svg1 = $this->sourceImage; //qrcode + $svg2 = $this->mergeImage; //logo + $svg2 = $svg2->setAttributeSvg($this->centerX, $this->centerY, $percentage); + $svg1 = $svg1->addChildren($svg2); + return $svg1; + } + + /** + * Sets the objects properties. + * + * @param $percentage float The percentage that the merge image should take up. + * + * @return void + */ + protected function setProperties($percentage) + { + if ($percentage > 1) { + throw new InvalidArgumentException('$percentage must be less than 1'); + } + + $this->sourceImageHeight = $this->sourceImage->getHeight(); + $this->sourceImageWidth = $this->sourceImage->getWidth(); + + $this->mergeImageHeight = $this->mergeImage->getHeight(); + $this->mergeImageWidth = $this->mergeImage->getWidth(); + + $this->calculateOverlap($percentage); + $this->calculateCenter(); + } + + /** + * Calculates the center of the source Image using the Merge image. + * + * @return void + */ + protected function calculateCenter() + { + $this->centerX = intval(($this->sourceImageWidth / 2) - ($this->postMergeImageWidth / 2)); + $this->centerY = intval(($this->sourceImageHeight / 2) - ($this->postMergeImageHeight / 2)); + } + + /** + * Calculates the width of the merge image being placed on the source image. + * + * @param float $percentage + * + * @return void + */ + protected function calculateOverlap($percentage) + { + $this->mergeRatio = round($this->mergeImageWidth / $this->mergeImageHeight, 2); + $this->postMergeImageWidth = intval($this->sourceImageWidth * $percentage); + $this->postMergeImageHeight = intval($this->postMergeImageWidth / $this->mergeRatio); + } +} diff --git a/src/SVGString.php b/src/SVGString.php new file mode 100644 index 0000000..4b1cda2 --- /dev/null +++ b/src/SVGString.php @@ -0,0 +1,83 @@ +image = SVG::fromString($image); + } + + private function getdocument() + { + return $this->image->getDocument(); + } + + /* + * Returns the width of an image + * + * @return int + */ + public function getWidth() + { + return (int) $this->image->getdocument()->getWidth(); + } + + /* + * Returns the height of an image + * + * @return int + */ + public function getHeight() + { + return (int) $this->image->getdocument()->getHeight(); + } + + /** + * Returns the image string. + * + * @return string + */ + public function getImageResource() + { + return $this->image; + } + + + public function setAttributeSvg(int $centerX, int $centerY, float $percentage) + { + return $this->image->getdocument()->getChild(0)->setAttribute('transform', 'translate(' . $centerX . ',' . $centerY . ') scale(' . $percentage . ')'); + } + + public function addChildren(SVGGroup $image) + { + $this->image->getdocument()->addChild($image); + $image = $this->image->toXmlString(); + return $image; + } + /** + * Sets the image string. + * + * @param resource $image + */ + public function setImageResource($image) + { + $this->image = $image; + } +}