Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 Generate SVG with mergesvg #300

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a5ea6fe
Update README.md
billyljren Mar 15, 2024
a086063
Update composer.json
billyljren Mar 15, 2024
87818b2
Update Generator.php
billyljren Mar 15, 2024
c0bd6d4
Update Image.php
billyljren Mar 15, 2024
fb2035b
Update ImageMerge.php
billyljren Mar 15, 2024
53a31e7
Update QrCodeServiceProvider.php
billyljren Mar 15, 2024
89d84f7
Update QrCode.php
billyljren Mar 15, 2024
6a25145
Update BTC.php
billyljren Mar 15, 2024
bbef12f
Update DataTypeInterface.php
billyljren Mar 15, 2024
6c58069
Update Email.php
billyljren Mar 15, 2024
2f046b6
Update Geo.php
billyljren Mar 15, 2024
78ab70f
Update PhoneNumber.php
billyljren Mar 15, 2024
382b664
Update SMS.php
billyljren Mar 15, 2024
b4cb9d4
Update WiFi.php
billyljren Mar 15, 2024
b22c732
Update GeneratorTest.php
billyljren Mar 15, 2024
a8e5930
Update ImageMergeTest.php
billyljren Mar 15, 2024
f234477
Update ImageTest.php
billyljren Mar 15, 2024
8be6c40
Update BTCTest.php
billyljren Mar 15, 2024
6eeee67
Update EmailTest.php
billyljren Mar 15, 2024
c052bae
Update GeoTest.php
billyljren Mar 15, 2024
d6d4c50
Update PhoneNumberTest.php
billyljren Mar 15, 2024
fe55d58
Update SMSTest.php
billyljren Mar 15, 2024
239f6a6
Update WiFiTest.php
billyljren Mar 15, 2024
066cf6b
Update CONTRIBUTING.md
billyljren Mar 15, 2024
65e5ee8
Update LICENSE
billyljren Mar 15, 2024
e690b02
Update SECURITY.md
billyljren Mar 15, 2024
996daa9
Update README.md
billyljren Mar 15, 2024
64caf9f
Update README.md
billyljren Mar 15, 2024
70368a0
fix: 🐛 Generate SVG with mergesvg
Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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!
Please submit all issues and pull requests to the [billyljren/easy-qrcode](https://github.com/billyljren/easy-qrcode) repository on the develop branch!
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 4 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Simple QrCode
Easy QRCode
========================

![Unit Tests](https://github.com/SimpleSoftwareIO/simple-qrcode/workflows/Unit%20Tests/badge.svg)
Expand All @@ -7,34 +7,12 @@ 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.

## Official Documentation

Documentation for Simple QrCode can be found on our [website.](http://www.simplesoftware.io/#/docs/simple-qrcode)

## Examples

![Example 1](docs/imgs/example-1.png) ![Example 2](docs/imgs/example-2.png)

## Use Cases
<p align="center">
<a href="https://www.rsvpify.com">
<img width="300" src="https://rsvpify.com/wp-content/uploads/2017/03/rsvpify-logo-header-rsvp.png">
</a>
</p>
<p align="center">
<a href="https://rsvpify.com/sell-tickets">Platform to sell tickets online</a>
</p>
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.

## Contributing
## Full Documentation

Please submit all issues and pull requests to the [simplesoftwareio/simple-qrcode](https://github.com/simplesoftwareio/simple-qrcode) repository on the develop branch!
https://github.com/billyljren/easy-qrcode/blob/develop/docs/en/README.md

## License

Expand Down
7 changes: 2 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 11 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"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": {
"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",
Expand All @@ -25,7 +26,7 @@
},
"autoload": {
"psr-4": {
"SimpleSoftwareIO\\QrCode\\": "src"
"BeaconsBay\\QrCode\\": "src"
}
},
"scripts": {
Expand All @@ -34,10 +35,10 @@
"extra": {
"laravel": {
"providers": [
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
"BeaconsBay\\QrCode\\QrCodeServiceProvider"
],
"aliases": {
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
"QrCode": "BeaconsBay\\QrCode\\Facades\\QrCode"
}
}
}
Expand Down
55 changes: 14 additions & 41 deletions docs/en/README.md
Original file line number Diff line number Diff line change
@@ -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
<p align="center">
<a href="https://www.rsvpify.com">
<img width="300" src="https://rsvpify.com/wp-content/uploads/2017/03/rsvpify-logo-header-rsvp.png">
</a>
</p>
<p align="center">
<a href="https://rsvpify.com/sell-tickets">Platform to sell tickets online</a>
</p>

<a id="docs-introduction"></a>
## 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)

<a id="docs-upgrade"></a>
## 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;
```

<a id="docs-configuration"></a>
## 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`

<a id="docs-ideas"></a>
## Simple Ideas
Expand All @@ -72,19 +44,20 @@ You may embed a qrcode inside of an e-mail to allow your users to quickly scan.
<img src="{!!$message->embedData(QrCode::format('png')->generate('Embed me into an e-mail!'), 'QrCode.png', 'image/png')!!}">

<a id="docs-usage"></a>

## Usage

#### Basic Usage

```
// 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!');

Expand Down Expand Up @@ -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) |

Expand All @@ -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!');
2 changes: 1 addition & 1 deletion src/DataTypes/BTC.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

class BTC implements DataTypeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/DataTypeInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

interface DataTypeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/Email.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

use BaconQrCode\Exception\InvalidArgumentException;

Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/Geo.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

class Geo implements DataTypeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/PhoneNumber.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

class PhoneNumber implements DataTypeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/SMS.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

class SMS implements DataTypeInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataTypes/WiFi.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode\DataTypes;
namespace BeaconsBay\QrCode\DataTypes;

class WiFi implements DataTypeInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Facades/QrCode.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace SimpleSoftwareIO\QrCode\Facades;
namespace BeaconsBay\QrCode\Facades;

use Illuminate\Support\Facades\Facade;
use SimpleSoftwareIO\QrCode\Generator;
use BeaconsBay\QrCode\Generator;

class QrCode extends Facade
{
Expand Down
8 changes: 7 additions & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode;
namespace BeaconsBay\QrCode;

use BaconQrCode\Common\ErrorCorrectionLevel;
use BaconQrCode\Encoder\Encoder;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode;
namespace BeaconsBay\QrCode;

class Image
{
Expand Down
2 changes: 1 addition & 1 deletion src/ImageMerge.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SimpleSoftwareIO\QrCode;
namespace BeaconsBay\QrCode;

use InvalidArgumentException;

Expand Down
Loading