Skip to content

Commit 0da02d9

Browse files
author
Corey McCormick
committed
Finish up docs and final tweaks
1 parent 2712a22 commit 0da02d9

36 files changed

+335
-84
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ Simple QrCode
99

1010
## [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)
1111

12-
## Try our dead simple, free file transfer service [keep.sh](https://keep.sh)
12+
Language files are currently out of date. We need volunteers to upgrade them to v3! Please submit a PR request!
13+
14+
### Try our dead simple, free file transfer service [keep.sh](https://keep.sh)
1315

1416
![keep.sh](https://user-images.githubusercontent.com/624784/59808382-06676800-92ca-11e9-87b7-70020b6aef5f.gif)
1517

16-
Upload files with a single curl command from your terminal! `curl --upload-file file.txt https://keep.sh`
18+
Upload files with a single curl command from your terminal! `curl --upload-file your-local-file.txt https://keep.sh`
1719

1820
## Introduction
1921
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.
@@ -22,6 +24,10 @@ Simple QrCode is an easy to use wrapper for the popular Laravel framework based
2224

2325
Documentation for Simple QrCode can be found on our [website.](https://www.simplesoftware.io/simple-qrcode)
2426

27+
## Examples
28+
29+
![Example 1](docs/imgs/example-1.png) ![Example 2](docs/imgs/example-2.png)
30+
2531
## Contributing
2632

2733
Please submit all issues and pull requests to the [simplesoftwareio/simple-qrcode](https://github.com/simplesoftwareio/simple-qrcode) repository on the develop branch!

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313
"require": {
1414
"php": ">=7.2",
1515
"ext-gd": "*",
16-
"bacon/bacon-qr-code": "~2"
16+
"bacon/bacon-qr-code": "2.0.0"
1717
},
1818
"require-dev": {
1919
"mockery/mockery": "~1",
2020
"phpunit/phpunit": "~9"
2121
},
2222
"suggest": {
23-
"illuminate/support": "Allows for use within Laravel"
23+
"ext-imagick": "Allows the generation of PNG QrCodes.",
24+
"illuminate/support": "Allows for use within Laravel."
2425
},
2526
"autoload": {
26-
"psr-0": {
27+
"psr-4": {
2728
"SimpleSoftwareIO\\QrCode\\": "src"
2829
}
2930
},

docs/en/README.md

Lines changed: 84 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Simple QrCode
1111

1212

1313
- [Introduction](#docs-introduction)
14-
- [Translations](#docs-translations)
14+
- [Upgrade Guide](#docs-upgrade)
1515
- [Configuration](#docs-configuration)
1616
- [Simple Ideas](#docs-ideas)
1717
- [Usage](#docs-usage)
@@ -29,32 +29,23 @@ Upload files with a single curl command from your terminal! `curl --upload-file
2929
## Introduction
3030
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.
3131

32-
<a id="docs-translations"></a>
33-
## Translations
34-
We are looking for users who speak Arabic, Spanish, French, Korean or Japanese to help translate this document. Please create a pull request if you are able to make a translation!
32+
![Example 1](../imgs/example-1.png) ![Example 2](../imgs/example-2.png)
3533

36-
<a id="docs-configuration"></a>
37-
## Configuration
38-
39-
#### Composer
40-
41-
First, add the Simple QrCode package to your `require` in your `composer.json` file:
34+
<a id="docs-upgrade"></a>
35+
## Upgrade Guide
4236

43-
"require": {
44-
"simplesoftwareio/simple-qrcode": "~2"
45-
}
37+
Upgrade from v2 by changing your `composer.json` file to `~3`
4638

47-
Next, run the `composer update` command.
39+
You **must** install the `imagick` PHP extension if you plan on using the `png` image format.
4840

49-
#### Service Provider
41+
<a id="docs-configuration"></a>
42+
## Configuration
5043

51-
###### Laravel <= 5.4
52-
Register the `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` in your `config/app.php` within the `providers` array.
44+
#### Composer
5345

54-
#### Aliases
46+
Run `composer require simplesoftwareio/simple-qrcode "~3"` to add the package.
5547

56-
###### Laravel <= 5.4
57-
Finally, register the `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` in your `config/app.php` configuration file within the `aliases` array.
48+
Laravel will automiatcally pick up and install the package.
5849

5950
<a id="docs-ideas"></a>
6051
## Simple Ideas
@@ -86,14 +77,14 @@ Using the QrCode Generator is very easy. The most basic syntax is:
8677

8778
This will make a QrCode that says "Make me into a QrCode!"
8879

89-
#### Generate
80+
![Example QrCode](../imgs/make-me-into-a-qrcode.png)
81+
82+
#### Generate `(string $data, string $filename = null)`
9083

9184
`Generate` is used to make the QrCode.
9285

9386
QrCode::generate('Make me into a QrCode!');
9487

95-
>Heads up! This method must be called last if using within a chain.
96-
9788
`Generate` by default will return a SVG image string. You can print this directly into a modern browser within Laravel's Blade system with the following:
9889

9990
{!! QrCode::generate('Make me into a QrCode!'); !!}
@@ -102,37 +93,87 @@ The `generate` method has a second parameter that will accept a filename and pat
10293

10394
QrCode::generate('Make me into a QrCode!', '../public/qrcodes/qrcode.svg');
10495

105-
#### Format Change
106-
107-
>QrCode Generator is setup to return a SVG image by default.
108-
109-
>Watch out! The `format` method must be called before any other formatting options such as `size`, `color`, `backgroundColor`, and `margin`.
96+
#### Format `(string $format)`
11097

111-
Three formats are currently supported; PNG, EPS, and SVG. To change the format use the following code:
98+
Three formats are currently supported; `png,` `eps,` and `svg.` To change the format use the following code:
11299

113-
QrCode::format('png'); //Will return a PNG image
114-
QrCode::format('eps'); //Will return a EPS image
115-
QrCode::format('svg'); //Will return a SVG image
100+
QrCode::format('png'); //Will return a png image
101+
QrCode::format('eps'); //Will return a eps image
102+
QrCode::format('svg'); //Will return a svg image
116103

117-
#### Size Change
104+
> `imagick` is required in order to generate a `png` image.
118105
119-
>QrCode Generator will by default return the smallest size possible in pixels to create the QrCode.
106+
#### Size `(int $size)`
120107

121108
You can change the size of a QrCode by using the `size` method. Simply specify the size desired in pixels using the following syntax:
122109

123110
QrCode::size(100);
124111

125-
#### Color Change
112+
![200 Pixels](../imgs/200-pixels.png) ![250 Pixels](../imgs/250-pixels.png)
113+
114+
#### Color `(int $red, int $green, int $blue, int $alpha = null)`
126115

127116
>Be careful when changing the color of a QrCode. Some readers have a very difficult time reading QrCodes in color.
128117
129-
All colors must be expressed in RGB (Red Green Blue). You can change the color of a QrCode by using the following:
118+
All colors must be expressed in RGBA (Red Green Blue Alpha). You can change the color of a QrCode by using the following:
119+
120+
QrCode::color(255, 0, 0); // Red QrCode
121+
QrCode::color(255, 0, 0, 25); //Red QrCode with 25% transparency
122+
123+
![Red QrCode](../imgs/red-qrcode.png) ![Red Transparent QrCode](../imgs/red-25-transparent.png)
124+
125+
#### Background Color `(int $red, int $green, int $blue, int $alpha = null)`
126+
127+
You can change the background color of a QrCode by calling the `backgroundColor` method.
128+
129+
QrCode::backgroundColor(255, 0, 0); // Red background QrCode
130+
QrCode::backgroundColor(255, 0, 0, 25); //Red background QrCode with 25% transparency
130131

131-
QrCode::color(255,0,255);
132+
![Red Background QrCode](../imgs/red-background.png) ![Red Transparent Background QrCode](../imgs/red-25-transparent-background.png)
132133

133-
Background color changes are also supported and be expressed in the same manner.
134+
#### Gradient `$startRed, $startGreen, $startBlue, $endRed, $endGreen, $endBlue, string $type)`
134135

135-
QrCode::backgroundColor(255,255,0);
136+
You can apply a gradient to the QrCode by calling the `gradient` method.
137+
138+
The following gradient types are supported.
139+
140+
| Type | Example |
141+
| --- | --- |
142+
| `vertical` | ![Veritcal](../imgs/vertical.png) |
143+
| `horizontal` | ![Horizontal](../imgs/horizontal.png) |
144+
| `diagonal` | ![Diagonal](../imgs/diagonal.png) |
145+
| `inverse_diagonal` | ![Invrse Diagonal](../imgs/inverse_diagonal.png) |
146+
| `radial` | ![Radial](../imgs/radial.png) |
147+
148+
#### EyeColor `(int $eyeNumber, int $innerRed, int $innerGreen, int $innerBlue, int $outterRed = 0, int $outterGreen = 0, int $outterBlue = 0)`
149+
150+
You may change the eye colors by using the `eyeColor` method.
151+
152+
| Eye Number | Example |
153+
| --- | --- |
154+
| `0` | ![Eye 0](../imgs/eye-0.png) |
155+
| `1` | ![Eye 1](../imgs/eye-1.png)|
156+
| `2` | ![Eye 2](../imgs/eye-2.png) |
157+
158+
159+
#### Style `(string $style, float $size = 0.5)`
160+
161+
The style can be easily swapped out with `square.` `dot,` or `round.` This will change the blocks within the QrCode. The second parameter will affect the size of the dots or roundness.
162+
163+
| Style | Example |
164+
| --- | --- |
165+
| `sqaure` | ![Sqaure](../imgs/200-pixels.png) |
166+
| `dot` | ![Dot](../imgs/dot.png)|
167+
| `round` | ![Round](../imgs/round.png) |
168+
169+
#### Eye Style `(string $style)`
170+
171+
The eye within the QrCode supports two different styles, `dot` and `circle.`
172+
173+
| Style | Example |
174+
| --- | --- |
175+
| `sqaure` | ![Sqaure](../imgs/200-pixels.png) |
176+
| `circle` | ![Circle](../imgs/circle-eye.png)|
136177

137178
#### Margin Change
138179

@@ -192,8 +233,6 @@ Change the character encoding that is used to build a QrCode. By default `ISO-8
192233
| GBK |
193234
| EUC-KR |
194235

195-
>An error of `Could not encode content to ISO-8859-1` means that the wrong character encoding type is being used. We recommend `UTF-8` if you are unsure.
196-
197236
#### Merge
198237

199238
The `merge` method merges an image over a QrCode. This is commonly used to placed logos within a QrCode.
@@ -232,7 +271,7 @@ The `mergeString` method can be used to achieve the same as the `merge` call, ex
232271
233272
#### Advance Usage
234273

235-
All methods support chaining. The `generate` method must be called last and any `format` change must be called first. For example you could run any of the following:
274+
All methods support chaining. The `generate` method must be called last. For example you could run any of the following:
236275

237276
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
238277
QrCode::format('png')->size(399)->color(40,40,40)->generate('Make me a QrCode!');
@@ -364,9 +403,9 @@ You can use a prefix found in the table below inside the `generate` section to c
364403
<a id="docs-outside-laravel"></a>
365404
## Usage Outside of Laravel
366405

367-
You may use this package outside of Laravel by instantiating a new `BaconQrCodeGenerator` class.
406+
You may use this package outside of Laravel by instantiating a new `Generator` class.
368407

369-
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
408+
use SimpleSoftwareIO\QrCode\Generator;
370409

371-
$qrcode = new BaconQrCodeGenerator;
410+
$qrcode = new Generator;
372411
$qrcode->size(500)->generate('Make a qrcode without Laravel!');

docs/imgs/200-pixels.png

1.49 KB
Loading

docs/imgs/250-pixels.png

1.68 KB
Loading

docs/imgs/circle-eye.png

2.15 KB
Loading

docs/imgs/diagonal.png

6.37 KB
Loading

docs/imgs/dot.png

5.33 KB
Loading

docs/imgs/example-1.png

8.08 KB
Loading

docs/imgs/example-2.png

24.1 KB
Loading

0 commit comments

Comments
 (0)