提交代码
This commit is contained in:
3
vendor/simplesoftwareio/simple-qrcode/.gitignore
vendored
Normal file
3
vendor/simplesoftwareio/simple-qrcode/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.idea
|
||||
/vendor
|
||||
composer.lock
|
||||
11
vendor/simplesoftwareio/simple-qrcode/.travis.yml
vendored
Normal file
11
vendor/simplesoftwareio/simple-qrcode/.travis.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
language: php
|
||||
sudo: false
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
before_script:
|
||||
- composer install --dev
|
||||
- composer update -o
|
||||
|
||||
script: phpunit --bootstrap tests/bootstrap.php --configuration phpunit.xml tests
|
||||
69
vendor/simplesoftwareio/simple-qrcode/CHANGELOG.md
vendored
Normal file
69
vendor/simplesoftwareio/simple-qrcode/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
Simple QrCode
|
||||
=============
|
||||
|
||||
##Change Log
|
||||
|
||||
#### 2.0.0
|
||||
* Fixed a bug where the merge image was not reset correctly. (#93)
|
||||
* Added Laravel auto discovery support. (#82) - Thanks [mazedlx](https://github.com/mazedlx)
|
||||
|
||||
#### 1.5.1
|
||||
* Fixed a bug where a QrCode used within a loop would not generate correctly.
|
||||
|
||||
#### 1.5.0
|
||||
* Added Portuguese translation. -Thanks [francisek](https://github.com/francisek) and [Varpie!](https://github.com/Varpie)
|
||||
* Added BitCoin helper
|
||||
|
||||
#### 1.4.6
|
||||
* Added Portuguese translation. -Thanks [felipewmartins!](https://github.com/felipewmartins)
|
||||
|
||||
#### 1.4.5
|
||||
* Added Spanish translation. -Thanks [gtarraga!](https://github.com/gtarraga)
|
||||
* Added Hindi translation. -Thanks [himanshu81494!](https://github.com/himanshu81494)
|
||||
|
||||
#### 1.4.4
|
||||
* Added Italian translation. -Thanks [simocosimo!](https://github.com/simocosimo)
|
||||
|
||||
#### 1.4.3
|
||||
* Updated the docs to our new format.
|
||||
* Correct some typos in the Russian translation.
|
||||
|
||||
#### 1.4.2
|
||||
* Added Russian translation. -Thanks Victoria!
|
||||
* Added Chinese translation. -Thanks [blusewang!](https://github.com/blusewang)
|
||||
|
||||
#### 1.4.1
|
||||
* Improved the quality of QrCodes with logos merge on them. -Thanks [tuupke!](https://github.com/tuupke)
|
||||
|
||||
#### 1.4.0
|
||||
* Added the `mergeString` method. This method adds the ability to pass in a binary string to create a QrCode with an image on it. -Thanks [tuupke!](https://github.com/tuupke)
|
||||
|
||||
#### 1.3.3
|
||||
* Allow absolute paths to be used with the `merge` method.
|
||||
|
||||
#### 1.3.2
|
||||
* Changed `bindShared` to `singleton` to support Laravel 5.2 -Thanks [lhdev!](https://github.com/lhdev)
|
||||
|
||||
#### 1.3.1
|
||||
* Fixed a bug where `merge` did not work as expected when used with `size.`
|
||||
|
||||
#### 1.3.0
|
||||
* Added `merge` method.
|
||||
* Fixed a typo in the readme.
|
||||
|
||||
#### 1.2.0
|
||||
* Added full support for Laravel 5
|
||||
* Added the following helpers.
|
||||
* E-Mail
|
||||
* Geo
|
||||
* Phone Number
|
||||
* SMS
|
||||
* WiFi
|
||||
|
||||
#### 1.1.1
|
||||
* Update dependencies.
|
||||
* Corrected some composer file issues.
|
||||
* Added some missing Laravel information to the QrCode Service Provider.
|
||||
|
||||
####1.1.0
|
||||
* Added the ability to change the character encoding.
|
||||
3
vendor/simplesoftwareio/simple-qrcode/CONTRIBUTING.md
vendored
Normal file
3
vendor/simplesoftwareio/simple-qrcode/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +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!
|
||||
21
vendor/simplesoftwareio/simple-qrcode/LICENSE
vendored
Normal file
21
vendor/simplesoftwareio/simple-qrcode/LICENSE
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Simple Software LLC www.simplesoftware.io
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
27
vendor/simplesoftwareio/simple-qrcode/README.md
vendored
Normal file
27
vendor/simplesoftwareio/simple-qrcode/README.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
## [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/hi) | [汉语](https://www.simplesoftware.io/docs/simple-qrcode/zh)
|
||||
|
||||
## Try our dead simple, free file transfer service [keep.sh](https://keep.sh)
|
||||
|
||||
## 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.](https://www.simplesoftware.io/docs/simple-qrcode)
|
||||
|
||||
## 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)
|
||||
38
vendor/simplesoftwareio/simple-qrcode/composer.json
vendored
Normal file
38
vendor/simplesoftwareio/simple-qrcode/composer.json
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "simplesoftwareio/simple-qrcode",
|
||||
"description": "Simple QrCode is a QR code generator made for Laravel.",
|
||||
"keywords": ["qrcode", "laravel", "simple", "generator", "wrapper"],
|
||||
"homepage": "http://www.simplesoftware.io",
|
||||
"license" : "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Simple Software LLC",
|
||||
"email": "support@simplesoftware.io"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"ext-gd": "*",
|
||||
"bacon/bacon-qr-code": "1.0.*",
|
||||
"illuminate/support": ">=5.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "~6"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"SimpleSoftwareIO\\QrCode\\": "src"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
365
vendor/simplesoftwareio/simple-qrcode/docs/en/README.md
vendored
Normal file
365
vendor/simplesoftwareio/simple-qrcode/docs/en/README.md
vendored
Normal file
@@ -0,0 +1,365 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
#### [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/hi) | [汉语](https://www.simplesoftware.io/docs/simple-qrcode/zh)
|
||||
|
||||
- [Introduction](#docs-introduction)
|
||||
- [Translations](#docs-translations)
|
||||
- [Configuration](#docs-configuration)
|
||||
- [Simple Ideas](#docs-ideas)
|
||||
- [Usage](#docs-usage)
|
||||
- [Helpers](#docs-helpers)
|
||||
- [Common QrCode Usage](#docs-common-usage)
|
||||
- [Usage Outside of Laravel](#docs-outside-laravel)
|
||||
|
||||
<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.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Translations
|
||||
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!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Configuration
|
||||
|
||||
#### Composer
|
||||
|
||||
First, add the Simple QrCode package to your `require` in your `composer.json` file:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Next, run the `composer update` command.
|
||||
|
||||
#### Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Register the `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` in your `config/app.php` within the `providers` array.
|
||||
|
||||
#### Aliases
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Finally, register the `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` in your `config/app.php` configuration file within the `aliases` array.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Simple Ideas
|
||||
|
||||
#### Print View
|
||||
|
||||
One of the main items that we use this package for is to have QrCodes in all of our print views. This allows our customers to return to the original page after it is printed by simply scanning the code. We achieved this by adding the following into our footer.blade.php file.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Scan me to return to the original page.</p>
|
||||
</div>
|
||||
|
||||
#### Embed A QrCode
|
||||
|
||||
You may embed a qrcode inside of an e-mail to allow your users to quickly scan. The following is an example of how to do this with Laravel.
|
||||
|
||||
//Inside of a blade template.
|
||||
<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
|
||||
|
||||
Using the QrCode Generator is very easy. The most basic syntax is:
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
This will make a QrCode that says "Make me into a QrCode!"
|
||||
|
||||
#### Generate
|
||||
|
||||
`Generate` is used to make the QrCode.
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
>Heads up! This method must be called last if using within a chain.
|
||||
|
||||
`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:
|
||||
|
||||
{!! QrCode::generate('Make me into a QrCode!'); !!}
|
||||
|
||||
The `generate` method has a second parameter that will accept a filename and path to save the QrCode.
|
||||
|
||||
QrCode::generate('Make me into a QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Format Change
|
||||
|
||||
>QrCode Generator is setup to return a SVG image by default.
|
||||
|
||||
>Watch out! The `format` method must be called before any other formatting options such as `size`, `color`, `backgroundColor`, and `margin`.
|
||||
|
||||
Three formats are currently supported; PNG, EPS, and SVG. To change the format use the following code:
|
||||
|
||||
QrCode::format('png'); //Will return a PNG image
|
||||
QrCode::format('eps'); //Will return a EPS image
|
||||
QrCode::format('svg'); //Will return a SVG image
|
||||
|
||||
#### Size Change
|
||||
|
||||
>QrCode Generator will by default return the smallest size possible in pixels to create the QrCode.
|
||||
|
||||
You can change the size of a QrCode by using the `size` method. Simply specify the size desired in pixels using the following syntax:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Color Change
|
||||
|
||||
>Be careful when changing the color of a QrCode. Some readers have a very difficult time reading QrCodes in color.
|
||||
|
||||
All colors must be expressed in RGB (Red Green Blue). You can change the color of a QrCode by using the following:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
Background color changes are also supported and be expressed in the same manner.
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Margin Change
|
||||
|
||||
The ability to change the margin around a QrCode is also supported. Simply specify the desired margin using the following syntax:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Error Correction
|
||||
|
||||
Changing the level of error correction is easy. Just use the following syntax:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
The following are supported options for the `errorCorrection` method.
|
||||
|
||||
| Error Correction | Assurance Provided |
|
||||
| --- | --- |
|
||||
| L | 7% of codewords can be restored. |
|
||||
| M | 15% of codewords can be restored. |
|
||||
| Q | 25% of codewords can be restored. |
|
||||
| H | 30% of codewords can be restored. |
|
||||
|
||||
>The more error correction used; the bigger the QrCode becomes and the less data it can store. Read more about [error correction](http://en.wikipedia.org/wiki/QR_code#Error_correction).
|
||||
|
||||
#### Encoding
|
||||
|
||||
Change the character encoding that is used to build a QrCode. By default `ISO-8859-1` is selected as the encoder. Read more about [character encoding](http://en.wikipedia.org/wiki/Character_encoding) You can change this to any of the following:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Make me a QrCode with special symbols ♠♥!!');
|
||||
|
||||
| Character Encoder |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>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.
|
||||
|
||||
#### Merge
|
||||
|
||||
The `merge` method merges an image over a QrCode. This is commonly used to placed logos within a QrCode.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//Generates a QrCode with an image centered in the middle.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>The `merge` method only supports PNG at this time.
|
||||
>The filepath is relative to app base path if `$absolute` is set to `false`. Change this variable to `true` to use absolute paths.
|
||||
|
||||
>You should use a high level of error correction when using the `merge` method to ensure that the QrCode is still readable. We recommend using `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Merge Binary String
|
||||
|
||||
The `mergeString` method can be used to achieve the same as the `merge` call, except it allows you to provide a string representation of the file instead of the filepath. This is usefull when working with the `Storage` facade. It's interface is quite similar to the `merge` call.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//Generates a QrCode with an image centered in the middle.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
>As with the normal `merge` call, only PNG is supported at this time. The same applies for error correction, high levels are recommened.
|
||||
|
||||
#### Advance Usage
|
||||
|
||||
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:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Make me a QrCode!');
|
||||
|
||||
You can display a PNG image without saving the file by providing a raw string and encoding with `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Make me into an QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Helpers
|
||||
|
||||
#### What are helpers?
|
||||
|
||||
Helpers are an easy way to create QrCodes that cause a reader to perform a certain action when scanned.
|
||||
|
||||
#### BitCoin
|
||||
|
||||
This helpers generates a scannable bitcoin to send payments. [More information](https://bitco.in/en/developer-guide#plain-text)
|
||||
|
||||
QrCode::BTC($address, $amount);
|
||||
|
||||
//Sends a 0.334BTC payment to the address
|
||||
QrCode::BTC('bitcoin address', 0.334);
|
||||
|
||||
//Sends a 0.334BTC payment to the address with some optional arguments
|
||||
QrCode::size(500)->BTC('address', 0.0034, [
|
||||
'label' => 'my label',
|
||||
'message' => 'my message',
|
||||
'returnAddress' => 'https://www.returnaddress.com'
|
||||
]);
|
||||
|
||||
#### E-Mail
|
||||
|
||||
This helper generates an e-mail qrcode that is able to fill in the e-mail address, subject, and body.
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//Fills in the to address
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//Fills in the to address, subject, and body of an e-mail.
|
||||
QrCode::email('foo@bar.com', 'This is the subject.', 'This is the message body.');
|
||||
|
||||
//Fills in just the subject and body of an e-mail.
|
||||
QrCode::email(null, 'This is the subject.', 'This is the message body.');
|
||||
|
||||
#### Geo
|
||||
|
||||
This helper generates a latitude and longitude that a phone can read and open the location up in Google Maps or similar app.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Phone Number
|
||||
|
||||
This helper generates a QrCode that can be scanned and then dials a number.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (Text Messages)
|
||||
|
||||
This helper makes SMS messages that can be prefilled with the send to address and body of the message.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//Creates a text message with the number filled in.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//Creates a text message with the number and message filled in.
|
||||
QrCode::SMS('555-555-5555', 'Body of the message');
|
||||
|
||||
#### WiFi
|
||||
|
||||
This helpers makes scannable QrCodes that can connect a phone to a WiFI network.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID of the network',
|
||||
'password' => 'Password of the network',
|
||||
'hidden' => 'Whether the network is a hidden SSID or not.'
|
||||
]);
|
||||
|
||||
//Connects to an open WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
]);
|
||||
|
||||
//Connects to an open, hidden WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//Connects to an secured, WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'myPassword'
|
||||
]);
|
||||
|
||||
>WiFi scanning is not currently supported on Apple Products.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
## Common QrCode Usage
|
||||
|
||||
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');
|
||||
|
||||
|
||||
| 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 |
|
||||
| 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; |
|
||||
| VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
## Usage Outside of Laravel
|
||||
|
||||
You may use this package outside of Laravel by instantiating a new `BaconQrCodeGenerator` class.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Make a qrcode without Laravel!');
|
||||
347
vendor/simplesoftwareio/simple-qrcode/docs/es/README.md
vendored
Normal file
347
vendor/simplesoftwareio/simple-qrcode/docs/es/README.md
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [Introducción](#docs-introduction)
|
||||
- [Traducciones](#docs-translations)
|
||||
- [Configuración](#docs-configuration)
|
||||
- [Ideas Simples](#docs-ideas)
|
||||
- [Uso](#docs-usage)
|
||||
- [Helpers](#docs-helpers)
|
||||
- [Uso Común de QrCode](#docs-common-usage)
|
||||
- [Uso fuera de Laravel](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## Introducción
|
||||
Simple QrCode es un empaquetador de fácil uso para el popular framework Laravel basado en el gran trabajo proporcionado por [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). Hemos creado una interfaz que es familiar y fácil de usar para los usuarios de Laravel.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Traducciones
|
||||
Estamos buscando usuarios que hablen Árabe, Francés, Coreano o Japonés para traducir este documento. Porfavor cread una pull request si podeis ayudar con una traducción!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Configuración
|
||||
|
||||
#### Composer
|
||||
|
||||
Primero, añadir el paquete Simple QrCode en su `require` en su archivo `composer.json`:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Luego, ejecutar el comando `composer update`.
|
||||
|
||||
#### Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Registrar `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` en su `config/app.php` dentro del array `providers`.
|
||||
|
||||
#### Aliases
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Finalmente, registrar `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` en su archivo de configuración `config/app.php` dentro del array `aliases`.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Ideas Simples
|
||||
|
||||
#### Print View
|
||||
|
||||
Uno de los principales usos de este paquete es la posibilidad de disponer QrCodes en todas nuestras print views. Esto permite a nuestros usuarios volver a la página original después de imprimir simplemente escaneando el código. Todo esto es posible añadiendo lo siguiente en nuestro archivo `footer.blade.php´.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Escanéame para volver a la página principal.</p>
|
||||
</div>
|
||||
|
||||
#### Incorporar un QrCode
|
||||
|
||||
Puedes incorporar un código Qr en un e-mail para permitir a los usuarios un ágil escaneo. El ejemplo siguiente muestra como hacer esto con Laravel.
|
||||
|
||||
//Inside of a blade template.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Incorpórame en un e-mail!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## Uso
|
||||
|
||||
#### Uso Básico
|
||||
|
||||
Usar el QrCode Generator es muy simple. La sintaxis más básica es:
|
||||
|
||||
QrCode::generate('Transfórmame en un QrCode!');
|
||||
|
||||
Esto creara un código que diga "Transfórmame en un QrCode!"
|
||||
|
||||
#### Generate
|
||||
|
||||
`Generate` se usa para crear el QrCode.
|
||||
|
||||
QrCode::generate('Transfórmame en un QrCode!');
|
||||
|
||||
>Atención! Este método debe de ser usado el último si se usa dentro de una cadena de comandos (chain).
|
||||
|
||||
`Generate` por defecto devolverá un string de una imagen SVG. Puedes imprimirla directamente en un navegador moderno con el sistema Blade de Laravel con el siguiente código:
|
||||
|
||||
{!! QrCode::generate('Transfórmame en un QrCode!'); !!}
|
||||
|
||||
El método `generate` tiene un segundo parámetro que aceptará un nombre de archivo y un directorio para guardar el QrCode.
|
||||
|
||||
QrCode::generate('Transfórmame en un QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Cambio de Formato
|
||||
|
||||
>QrCode Generator por defecto devolverá una imagen SVG.
|
||||
|
||||
>Atención! El método `format` tiene que ser usado antes que cualquier opción de formato como `size`, `color`, `backgroundColor`, o `margin`.
|
||||
|
||||
Actualmente hay 3 formatos compatibles; PNG, EPS, and SVG. Para cambiar el formato usa el siguiente código:
|
||||
|
||||
QrCode::format('png'); //Devolvera una imagen PNG
|
||||
QrCode::format('eps'); //Devolvera una imagen EPS
|
||||
QrCode::format('svg'); //Devolvera una imagen SVG
|
||||
|
||||
#### Cambio de Tamaño
|
||||
|
||||
>QrCode Generator devolverá por defecto el tamaño de píxels mínimo para crear el QrCode.
|
||||
|
||||
Puedes cambiar el tamaño de un QrCode usando el método `size`. Simplemente especifica el tamaño deseado en píxels usando el siguiente código:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Cambio de Color
|
||||
|
||||
>Presta atención al cambiar el color de un QrCode. Algunos lectores tienen dificultades al leer QrCodes en color.
|
||||
|
||||
Todos los colores deben ser expresados en RGB (Red Green Blue). Puedes cambiar el color del QrCode usando el siguiente código:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
Para cambiar el color del fondo usamos:
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Cambio de Márgenes
|
||||
|
||||
Es posible cambiar el márgen alrededor del QrCode. Simplemente especificamos el márgen deseado usando el siguiente código:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Corrección de Errores
|
||||
|
||||
Cambiar el nivel de corrección de errores es fácil. Unicamente usa el siguiente código:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
Las siguientes opciónes son compatibles con el método de `errorCorrection`.
|
||||
|
||||
| Error Correction | Assurance Provided |
|
||||
| --- | --- |
|
||||
| L | 7% of codewords can be restored. |
|
||||
| M | 15% of codewords can be restored. |
|
||||
| Q | 25% of codewords can be restored. |
|
||||
| H | 30% of codewords can be restored. |
|
||||
|
||||
>Cuanto más corrección de error se usa; el QrCode aumenta y puede almacenar menos datos. Para saber más sobre [corrección de error](http://en.wikipedia.org/wiki/QR_code#Error_correction).
|
||||
|
||||
#### Encoding
|
||||
|
||||
Para cambiar la codificación de carácteres que se usa para crear un QrCode. Por defecto `ISO-8859-1` está seleccionado. Para saber más sobre [codificación de carácteres](http://en.wikipedia.org/wiki/Character_encoding) You can change this to any of the following:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Transfórmame en un QrCode con símbolos especiales ♠♥!!');
|
||||
|
||||
| Codificador de carácteres |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>Un error de `Could not encode content to ISO-8859-1` significa que se esta usando una codificación de carácteres incorrecta. Recomendamos `UTF-8` si no está seguro.
|
||||
|
||||
#### Merge
|
||||
|
||||
El método `merge` une una imagen con un QrCode. Normalmente se usa para añadir logos en un QrCode.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//Genera un QrCode con una imagen en el centro.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//Genera un QrCode con una imagen en el centro. La imagen ocupa un 30% del QrCode.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//Genera un QrCode con una imagen en el centro. La imagen ocupa un 30% del QrCode.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>El método `merge` sólo es compatible con PNG de momento.
|
||||
>El path del archivo es relativo al path de la app si `$absolute` equivale a `false`. Cambia esta variable a `true` para usar paths absolutos.
|
||||
|
||||
>Se debería usar un nivel alto de corrección de error al usar `merge` para asegurarse que el QrCode se sigue podiendo leer. Recomendamos usar `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Merge Binary String
|
||||
|
||||
El método `mergeString` se puede usar para conseguir el mismo resultado que con `merge`, con la diferencia que permite proveer una representación en string del archivo en vez de el filepath. Ésto es útil al trabajar con el `Storage` facade. Su interfaz es muy similar a la de `merge`.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//Genera un QrCode con una imagen en el centro.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//Genera un QrCode con una imagen en el centro. La imagen ocupa un 30% del QrCode.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
>Igual que con `merge`, sólo PNG de momento. Lo mismo que con el nivel de corrección de error, alto nivel está recomendado.
|
||||
|
||||
#### Uso Avanzado
|
||||
|
||||
Todos los métodos soportan chaining. El método `generate` tiene que ser el último y cualquier cambio de `format` tiene que ser llamado primero. Por ejemplo:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Transfórmame en un QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Transfórmame en un QrCode!');
|
||||
|
||||
Puedes mostrar una imagen PNG sin guardar el archivo usando una string y eligiendo la codificación `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Transfórmame en un QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Helpers
|
||||
|
||||
#### Qué son los helpers?
|
||||
|
||||
Los helpers son una manera fácil de crear QrCodes que causan que causan una acción en el lector al escanear.
|
||||
|
||||
#### E-Mail
|
||||
|
||||
Este helper genera un QrCode de e-mail que es capaz de rellenar dirección e-mail, asunto, y el cuerpo del e-mail.
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//Rellena la dirección
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//Rellena la dirección, el asunto y el cuerpo.
|
||||
QrCode::email('foo@bar.com', 'This is the subject.', 'This is the message body.');
|
||||
|
||||
//Solo rellena el asunto y el cuerpo del e-mail.
|
||||
QrCode::email(null, 'This is the subject.', 'This is the message body.');
|
||||
|
||||
#### Geo
|
||||
|
||||
Este helper genera una latitude y una longitude que un teléfono puede leer y abrir la localización en Google Maps o alguna app similar.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Phone Number
|
||||
|
||||
Este helper genera un QrCode que puede ser escaneado y llama a un número de teléfono.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (Mensajes de texto)
|
||||
|
||||
Este helper crea SMS que pueden ser previamente rellenados con la dirección y el mensaje.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//Crea un mensaje de texto con el número rellenado.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//Crea un mensaje de texto con el número y el mensaje rellenados.
|
||||
QrCode::SMS('555-555-5555', 'Mensaje');
|
||||
|
||||
#### WiFi
|
||||
|
||||
Este helpers crea QrCodes que conectan un teléfono a una red WiFI.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID de la red',
|
||||
'password' => 'Password de la red',
|
||||
'hidden' => 'Si la red tiene SSID oculta o no.'
|
||||
]);
|
||||
|
||||
//Conecta a una red abierta.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
]);
|
||||
|
||||
//Conecta a una red abierta y oculta.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//Conecta a una red segura.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'myPassword'
|
||||
]);
|
||||
|
||||
>WiFi scanning no es compatible con productos Apple.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
##Uso común de QrCode
|
||||
|
||||
Puedes usar un prefijo de la tabla dentro de la sección `generate` para crear un QrCode que almacene informacion avanzada:
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| 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 |
|
||||
| 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; |
|
||||
| VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
##Uso fuera de Laravel
|
||||
|
||||
Puedes usar este paquete fuera de Laravel instanciando una nueva clase `BaconQrCodeGenerator`.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Crea un QrCode sin Laravel!');
|
||||
348
vendor/simplesoftwareio/simple-qrcode/docs/fr/README.md
vendored
Normal file
348
vendor/simplesoftwareio/simple-qrcode/docs/fr/README.md
vendored
Normal file
@@ -0,0 +1,348 @@
|
||||
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [Introduction](#docs-introduction)
|
||||
- [Traductions](#docs-translations)
|
||||
- [Configuration](#docs-configuration)
|
||||
- [Utilisations Simples](#docs-ideas)
|
||||
- [Usage](#docs-usage)
|
||||
- [Helpers](#docs-helpers)
|
||||
- [Usage Courant De QrCode](#docs-common-usage)
|
||||
- [Usage Hors De Laravel](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## Introduction
|
||||
Simple QrCode est un adaptateur facile d'utilisation pour le framework Laravel et qui s'appuie sur le magnifique travail fourni par [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). Nous avons conçu une interface intuitive, facile d'installation et familière aux utilisateurs de Laravel.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Traductions
|
||||
Nous recherchons des utilisateurs parlant arabe, espagnol, français, coréen ou japonnais pour nous aider à traduire cette documentation. Si vous vous en sentez capable, créez une pull request !
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Configuration
|
||||
|
||||
#### Composer
|
||||
|
||||
Commencez par ajouter le paquet QrCode à la section `require` de votre fichier `composer.json`:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Lancez ensuite la commande `composer update`.
|
||||
|
||||
#### Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Ajouter l'entrée `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` au tableau `providers` du fichier de configuration `config/app.php`.
|
||||
|
||||
#### Alias
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Enfin, ajoutez l'entrée `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` au tableau `aliases` du fichier de configuration `config/app.php`.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Utilisations Simples
|
||||
|
||||
#### Print View
|
||||
|
||||
L'un des pricipaux usages que nous faisons de ce paquet et d'avoir des QrCodes dans toutes nos vues d'impression. Cela donne la possibilité à nos clients qui le flashent de revenir à la page d'origine du document après que celui-ci a été imprimé. Nous obtenons cette fonctionnalité en ajoutant le code suivant au fichier footer.blade.php.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Flashez-moi pour revenir à la page d'origine.</p>
|
||||
</div>
|
||||
|
||||
#### Embarquer Un QrCode
|
||||
|
||||
Vous pouvez embarquer un qrcode dans un courriel pour permettre à vos utilisateurs de le flasher. Voici un exemple pour mettre ceci en œuvre dans Laravel :
|
||||
|
||||
// Dans un template blade.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Embarquez-moi dans un courriel!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## Usage
|
||||
|
||||
#### Usage De Base
|
||||
|
||||
L'utilisation du Générateur de QrCode est très simple. La syntaxe minimale est :
|
||||
|
||||
QrCode::generate('Transformez-moi en QrCode !');
|
||||
|
||||
Cela créera un QrCode qui dit "Transformez-moi en QrCode !"
|
||||
|
||||
#### Generate
|
||||
|
||||
`Generate` sert à fabriquer un QrCode.
|
||||
|
||||
QrCode::generate('Transformez-moi en QrCode !');
|
||||
|
||||
>Attention! Cette méthode doit être appelée en dernier si vous l'utilisez dans un appel chaîné.
|
||||
|
||||
Par défaut, `Generate` retournera le contenu d'une image SVG sous forme de chaîne. Vous pouvez afficher cette image directement avec un navigateur moderne dans un template Blade de Laravel de cette façon :
|
||||
|
||||
{!! QrCode::generate('Transformez-moi en QrCode !'); !!}
|
||||
|
||||
La méthode `generate` accepte un second paramètre pour définir un nom de fichier où enregistrer le QrCode.
|
||||
|
||||
QrCode::generate('Transformez-moi en QrCode !', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Changement De Format
|
||||
|
||||
>Le générateur de QrCode est prévu pour retourner une image SVG par défaut.
|
||||
|
||||
>Attention! La méthode `format` doit être appelée avant toute autre option de formatage, telles que `size`, `color`, `backgroundColor` et `margin`.
|
||||
|
||||
Trois formats sont actuellement supportés : PNG, EPS et SVG. Pour changer de format, utilisez le code suivant :
|
||||
|
||||
QrCode::format('png'); // retourne une image PNG
|
||||
QrCode::format('eps'); // retourne une image EPS
|
||||
QrCode::format('svg'); // retourne une image SVG
|
||||
|
||||
#### Changement De Taille
|
||||
|
||||
>Le générateur de QrCode retournera par défaut le QrCode dans la plus petite taille possible en pixels.
|
||||
|
||||
Vous pouvez changer la taille du QrCode par la méthode `size` qui prend comme paramètre la taille désirée en pixels :
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Changement De Couleur
|
||||
|
||||
>Changez les couleurs de vos QrCode avec précaution car certains lecteurs rencontrent des difficultés avec les QrCodes en couleur.
|
||||
|
||||
Toutes les couleurs doivent être exprimées en RGB (rouge, vert, bleu). Vous pouvez changer la couleur de trait du QrCode par la méthode `color` :
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
La couleur de fond peut être définie de la même façon par la méthode `backgroundColor` :
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Changement Des Marges
|
||||
|
||||
Vous pouvez définir une marge autour du QrCode par la méthode `margin` :
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Correction D'Erreur
|
||||
|
||||
Il est très aisé de changer le niveau de correction d'erreur. Utilisez la syntaxe suivante :
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
Voici la liste des options supportées pour la méthode `errorCorrection`.
|
||||
|
||||
| Correction d'Erreur | Capacité De Correction |
|
||||
| --- | --- |
|
||||
| L | 7% de redondance. |
|
||||
| M | 15% de redondance. |
|
||||
| Q | 25% de redondance. |
|
||||
| H | 30% de redondance. |
|
||||
|
||||
>L'élévation du niveau de correction d'erreur se fait au détriment de la taille du QrCode et de la quantité de données qu'il peut stocker. Pour en savoir plus, consultez [error correction](http://en.wikipedia.org/wiki/QR_code#Error_correction) (en anglais).
|
||||
|
||||
#### Encodage
|
||||
|
||||
La norme de codage par défaut des caractères contenus dans le QrCode est l'`ISO-8859-1`. Pour en savoir plus sur le codage, voyez [codage des caractères](http://fr.wikipedia.org/wiki/Codage_des_caractères). Vous pouvez changer le codage par le code suivant :
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Transformez-moi en QrCode avec des symboles ♠♥!!');
|
||||
|
||||
| Codage Des Caractères |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>Une erreur du type `Could not encode content to ISO-8859-1` signifie qu'un mauvais codage est utilisé. Nous recommendons `UTF-8` si vous n'êtes pas sûr.
|
||||
|
||||
#### Merge
|
||||
|
||||
La méthode `merge` fusionne une image sur un QrCode. C'est une pratique courante pour placer un logo dans un QrCode.
|
||||
|
||||
QrCode::merge($nom_de_fichier, $pourcentage, $absolu);
|
||||
|
||||
// Génère un QrCode avec une image centrée.
|
||||
QrCode::format('png')->merge('chemin-vers-l-image.png')->generate();
|
||||
|
||||
// Génère un QrCode avec une image centrée. L'image recouvre jusque 30% du QrCode.
|
||||
QrCode::format('png')->merge('chemin-vers-l-image.png', .3)->generate();
|
||||
|
||||
// Génère un QrCode avec une image centrée. L'image recouvre jusque 30% du QrCode.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>La méthode `merge` ne supporte que les images PNG.
|
||||
>Le chemin vers l'image est relatif au chemin de base de l'application si $absolu est à `false`. Changez cette variable à `true` pour utiliser des chemins absolus.
|
||||
|
||||
> Vous devriez utiliser un haut niveau de correction d'erreur avec la méthode `merge` pour assurer la bonne lecture du QrCode. Nous recommandons l'utilisation de `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Fusion De Chaîne Binaire
|
||||
|
||||
La méthode `mergeString` est semblable à la méthode `merge` si ce n'est qu'elle prend comme paramètre le contenu du fichier sous forme de chaîne au lieu du nom du fichier. C'est particulièrement utile lorsque vous travaillez avec une façade `Storage`. L'interface de `mergeString` est très similaire à celle de `merge`.
|
||||
|
||||
QrCode::mergeString(Storage::get('chemin/vers/image.png'), $percentage);
|
||||
|
||||
// Génère un QrCode avec une image centrée.
|
||||
QrCode::format('png')->mergeString(Storage::get('chemin/vers/image.png'))->generate();
|
||||
|
||||
// Génère un QrCode avec une image centrée. L'image recouvre jusque 30% du QrCode.
|
||||
QrCode::format('png')->mergeString(Storage::get('chemin/vers/image.png'), .3)->generate();
|
||||
|
||||
>A l'instar de la méthode `merge`, seul le format d'image PNG est supporté. Les même recommandations relatives à la correction d'erreur s'appliquent.
|
||||
|
||||
#### Utilisation Avancée
|
||||
|
||||
Toutes les méthodes supportent le chaînage. La méthode `generate` doit être appelée en dernier et toute modification du `format` en premier. Vous pourriez par exemple écrire :
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Transformez-moi en QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Transformez-moi en QrCode!');
|
||||
|
||||
Vous pouvez afficher une image PNG sans enregistrer de fichier en spécifiant une chaîne brute encodée avec `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Transformez-moi en QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Helpers
|
||||
|
||||
#### Que sont les helpers?
|
||||
|
||||
Les helpers facilitent la création de QrCodes qui déclenchent une action du lecteur lorsqu'ils sont flashés.
|
||||
|
||||
#### E-Mail
|
||||
|
||||
Cet helper génère un QrCode pour l'envoi de courriel dont les destinataire, sujet et contenu peuvent être prédéfinis.
|
||||
|
||||
QrCode::email($destinataire, $sujet, $contenu);
|
||||
|
||||
// Renseigne l'adresse du destinataire
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
// Renseigne le destinataire, le sujet et le contenu du courriel
|
||||
QrCode::email('foo@bar.com', 'Ceci est le sujet.', 'Ceci est le contenu.');
|
||||
|
||||
// Ne renseigne que le sujet et le contenu du courriel
|
||||
QrCode::email(null, 'Ceci est le sujet.', 'Ceci est le contenu.');
|
||||
|
||||
#### Geo
|
||||
|
||||
Cet helper génère un QrCode avec des coordonnées géographiques (latitude et longitude) qui pourront être ouvertes par une application Google Maps ou similaire.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Numéro de Téléphone
|
||||
|
||||
Cet helper génère un QrCode qui lorsqu'il est flashé compose un numéro de téléphone.
|
||||
|
||||
QrCode::phoneNumber($numeroDeTelephone);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (Messages Texte)
|
||||
|
||||
Cet helper génère un QrCode d'envoi de SMS dont le destinataire et le message peuvent être prédéfinis.
|
||||
|
||||
QrCode::SMS($numeroDeTelephone, $message);
|
||||
|
||||
// Crée un SMS pour un numéro de téléphone
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
// Crée un SMS pour un numéro de téléphone avec un message
|
||||
QrCode::SMS('555-555-5555', 'Corps du message');
|
||||
|
||||
#### WiFi
|
||||
|
||||
Cet helper génère un QrCode qui permet la connexion à un réseau WiFi.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID du réseau',
|
||||
'password' => 'Mot de passe de connexion',
|
||||
'hidden' => 'Indique si le SSID du réseau est masqué ou non.'
|
||||
]);
|
||||
|
||||
// Connexion à un réseau WiFi ouvert
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nom du réseau',
|
||||
]);
|
||||
|
||||
// Connexion à un réseau WiFi ouvert et masqué
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nom du réseau',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
// Connexion à un réseau WiFi sécurisé
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nom du réseau',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'Mot de passe'
|
||||
]);
|
||||
|
||||
>La recherche de réseaux WiFi n'est actuellement pas supportée par les produis Apple.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
## Usage Courant des QrCodes
|
||||
|
||||
Vous pouvez utiliser un des pseudos-protocoles du tableau suivant comme paramètre de la méthode `generate` pour créer un QrCode contenant des informations avancées :
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| Usage | Protocole | Exemple |
|
||||
| --- | --- | --- |
|
||||
| URL de site internet | http:// | http://www.simplesoftware.io |
|
||||
| URL de site internet sécurisé | https:// | https://www.simplesoftware.io |
|
||||
| Adresse de courriel | mailto: | mailto:support@simplesoftware.io |
|
||||
| Numéro de téléphone | tel: | tel:555-555-5555 |
|
||||
| SMS | sms: | sms:555-555-5555 |
|
||||
| SMS avec message pré-défini | sms: | sms::I am a pretyped message |
|
||||
| SMS avec message et numéro de téléphone pré-définis | sms: | sms:555-555-5555:I am a pretyped message |
|
||||
| Coordonnées géographiques | geo: | geo:-78.400364,-85.916993 |
|
||||
| MeCard | mecard: | MECARD:Simple, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@simplesoftware.io; |
|
||||
| VCard | BEGIN:VCARD | [Voir les exemples](https://fr.wikipedia.org/wiki/Code_QR#Correction_d.27erreur) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
##Usage Hors De Laravel
|
||||
|
||||
Vous pouvez utiliser ce paquet en dehors de Laravel en instanciant un objet de classe `BaconQrCodeGenerator`.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Créer un qrcode sans Laravel!');
|
||||
346
vendor/simplesoftwareio/simple-qrcode/docs/hi/README.md
vendored
Normal file
346
vendor/simplesoftwareio/simple-qrcode/docs/hi/README.md
vendored
Normal file
@@ -0,0 +1,346 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [परिचय](#docs-introduction)
|
||||
- [अनुवाद](#docs-translations)
|
||||
- [विन्यास](#docs-configuration)
|
||||
- [साधारण विचार](#docs-ideas)
|
||||
- [उपयोग](#docs-usage)
|
||||
- [सहायक](#docs-helpers)
|
||||
- [साधारण QrCode उपयोग](#docs-common-usage)
|
||||
- [लरावेल(Laravel) के बाहर उपयोग](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## परिचय
|
||||
सरल क्यूआरकोड [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode) द्वारा प्र्दान किए गये महान कार्य पर आधारित लोकप्रिय Laravel ढ़ाचा के लिए आसानी से प्रयोग करने योग्य आवरण है। हमने लरावेल उपयोगकर्ताओं के लिए परिचित व आसानी से स्थापित करने योग्य एक अंतरफलक बनाया है।
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## अनुवाद
|
||||
हमे उनकी खोज है जो इस दस्तावेज़ का अरबी, स्पेनिश, फ्रेंच, कोरियाई या जापानी मे अनुवाद करने मे मदद कर सकते हैं। यदि आप एक अनुवाद करने में सक्षम हैं तो कृपया एक पुल अनुरोध बनाए!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## विन्यास
|
||||
|
||||
#### Composer
|
||||
|
||||
सर्वप्रथं composer.json मे qrcode पॅकेज को अपने require से जोड़ें:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
फिर composer update कमॅंड चलाएँ।
|
||||
|
||||
#### Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
config/app.php में providers array में SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class को रजिस्टर करें।
|
||||
|
||||
#### Aliases (उपनाम)
|
||||
|
||||
###### Laravel <= 5.4
|
||||
आखिर में 'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class को config/app.php विन्यास फ़ाइल में aliases array में रजिस्टर करें।
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## साधारण विचार
|
||||
|
||||
#### Print View (प्रिंट देखें)
|
||||
|
||||
इस पैकेज का मुख्य रूप से उपयोग हम सभी print views मे QrCode डालने के लिए करते हैं। यह हमारे ग्राहकों को स्कैन करके के बाद मूल पृष्ठ पर लौटने के लिए अनुमित करता है। हमने अपने footer.blade.php फ़ाइल में निम्न जोड़कर इसे हासिल किया है।
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Scan me to return to the original page.</p>
|
||||
</div>
|
||||
|
||||
#### Embed A QrCode
|
||||
|
||||
अपने उपयोगकर्ताओं को जल्दी से स्कैन करने के लिए आप एक ई-मेल के अंदर एक qrcode एम्बेड कर सकते हैं। निम्नलिखित लरावेल के साथ ऐसा करने का एक उदाहरण है।
|
||||
|
||||
//Inside of a blade template.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Embed me into an e-mail!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## उपयोग
|
||||
|
||||
#### Basic Usage (साधारण उपयोग)
|
||||
|
||||
QrCode Generator का उपयोग बेहद आसान है:
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
इससे qrcode कहेगा है कि "मुझे एक qrcode में बनाओ!"
|
||||
|
||||
#### Generate
|
||||
|
||||
Generate QrCode बनाने के काम आता है।
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
>सचेत! यह विधि श्रृंखला में अंतिम में पुकारी जानी चाहिए।
|
||||
`जेनरेट` डिफ़ॉल्ट रूप से SVG छवि की स्ट्रिंग लौटता है। आप इसे सीधे ही Laravel's Blade system से निम्न प्रकार से किसी भी आधुनिक ब्राउज़र मे प्रिंट ले सकते हैं:
|
||||
|
||||
{!! QrCode::generate('Make me into a QrCode!'); !!}
|
||||
|
||||
उत्पन्न विधि का एक दूसरे पैरामीटर है जो एक फ़ाइल का नाम और पथ QrCode को बचाने के लिए स्वीकार करता है।
|
||||
|
||||
QrCode::generate('Make me into a QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Format Change(प्रारूप बदलें)
|
||||
|
||||
>QrCode Generator डिफ़ॉल्ट रूप से SVG चित्र लौटाता है.
|
||||
|
||||
>ध्यान रहे! `format` की विधि को किसी भी अन्य स्वरूपण विकल्प जैसे कि `size`, `color`, `backgroundColor`, व `margin` से पहले ही कॉल करें.
|
||||
|
||||
निम्न तीन स्वरूप वर्तमान मे समर्थित हैं; PNG, EPS, और SVG. निम्न कोड का उपयोग करें:
|
||||
|
||||
QrCode::format('png'); //Will return a PNG image
|
||||
QrCode::format('eps'); //Will return a EPS image
|
||||
QrCode::format('svg'); //Will return a SVG image
|
||||
|
||||
#### Size Change (आकार बदल)
|
||||
|
||||
>QrCode Generator डिफ़ॉल्ट रूप से सबसे छोटी संभव आकार से QrCode बनाएग।
|
||||
|
||||
आप `आकार` विधि का उपयोग कर एक QRCode का आकार बदल सकते हैं। बस निम्न वाक्य-विन्यास का उपयोग करके पिक्सल मे वांछित आकर निर्दिष्ट करें:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Color Change (रंग का बदलना)
|
||||
|
||||
>QrCode का रंग बदलते समय सतर्क रहें। कई उपयोगकर्ताओं को भिन्न रंगों मे QrCode पढ़ने मे कठिनाई होती है।
|
||||
|
||||
सभी रंगों को RGB(लाल हरा नीला) मे व्यक्त करना आवश्यक है। आप निम्न का उपयोग करने QrCode का रंग बदल सकते हैं:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
पृष्ठभूमि रंग परिवर्तन भी इस ही तरीके से व्यक्त किया जा सकता है।
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Size Change (हाशिया परिवर्तन)
|
||||
|
||||
एक QrCode के आसपास हाशिया बदलने की क्षमता भी प्रदान की गयी है। इच्छित हाशिया निम्न वाक्य-विन्यास के अनुसार व्यक्त करें:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Error Correction (त्रुटि सुधार)
|
||||
|
||||
त्रुटि सुधार के स्तर को बदलना भी आसान है। निम्न वाक्य - विन्यास के अनुसार चलें:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
`errorCorrection` की विधि के लिए निम्न विकल्प समर्थित हैं:
|
||||
|
||||
| गलतीयों का सुधार | प्रस्तावित आश्वासन |
|
||||
| --- | --- |
|
||||
| L | 7% codewords में से बहाल किए जा सकते हैं। |
|
||||
| M | 15% codewords में से बहाल किए जा सकते हैं। |
|
||||
| Q | 25% codewords में से बहाल किए जा सकते हैं। |
|
||||
| H | 30% codewords में से बहाल किए जा सकते हैं। |
|
||||
|
||||
>अधिक त्रुटि सुधार के उपयोग से QrCode बड़ा हो जाता है और कम सूचना जमा कर सकता है। [त्रुटि सुधार](http://en.wikipedia.org/wiki/QR_code#Error_correction) के बारे मे अधिक पढ़ें।
|
||||
|
||||
#### Encoding(एन्कोडिंग)
|
||||
|
||||
वर्ण एन्कोडिंग को बदलें जिसका प्रयोग QrCode का निर्माण करने के लिए किया जाता है। डिफ़ॉल्ट रूप से `ISO-8859-1` एनकोडर के रूप में चयनित है।[वर्ण एनकोडिंग](http://en.wikipedia.org/wiki/Character_encoding) के बारे में अधिक पढ़ें। आप निम्न में से किसी के लिए इसे बदल सकते हैं:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Make me a QrCode with special symbols ♠♥!!');
|
||||
|
||||
| वर्ण एनकोडर |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>`Could not encode content to ISO-8859-1` त्रुटि का अर्थ है कि ग़लत वर्ण एनकोड का प्रकार उपयोग किया गया है। यदि आप अनिश्चित हैं तो हमारा सुझाव है कि `UTF-8` का उपयोग करें।
|
||||
|
||||
#### Merge(विलय)
|
||||
|
||||
`मर्ज` विधि एक QrCode पर एक छवि विलीन करता है। यह आमतौर पर एक QrCode के भीतर लोगो रखने के लिए प्रयोग किया जाता है।
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//Generates a QrCode with an image centered in the middle.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>`मर्`ज विधि में अभी केवल PNG ही समर्थित है।
|
||||
>filepath app, base path से सापेक्षित है यदि `$absolute` सेट है `false` पर। इसे `true` से बदलें absolute paths पाने के लिए।
|
||||
|
||||
>आपको `merge` विधि का इस्तेमाल करते समय उच्च स्तर के त्रुटि सुधार का उपयोग करना चाहिए। सुझाव है कि `errorCorrection('H')` का उपयोग करें।
|
||||
|
||||

|
||||
|
||||
#### Merge Binary String(द्विआधारी स्ट्रिंग का विलय)
|
||||
|
||||
`mergeString` विधि `मर्ज कॉल` वाले ही परिणाम पाने के लिए प्रयोग किया जा सकता है, सिवाय इसके कि इसमे आपको फ़ाइल पथ की बजाय फाइल की एक प्रतिनिधित्व स्ट्रिंग प्रदान करनी होती है। यह तब उपयोगी है जब `स्टोरेज` मुखौटे के साथ काम किया जाता है। इसका इंटरफेस मर्ज कॉल की तरह ही है।
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//Generates a QrCode with an image centered in the middle.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//Generates a QrCode with an image centered in the middle. The inserted image takes up 30% of the QrCode.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
>As with the normal `merge` call, only PNG is supported at this time. The same applies for error correction, high levels are recommened.
|
||||
|
||||
#### Advance Usage(अग्रिम उपयोग)
|
||||
|
||||
सभी तरीके श्रृंखलन का समर्थन करते हैं। `generate` तरीका अंत मे कॉल करना तथा तरीका कोई `format` का बदलाव सबसे पहले कॉल करना आवश्यक है। जैसे की आप निम्न मे से कोई भी रन कर सकते हैं:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Make me a QrCode!');
|
||||
|
||||
आप बिना फ़ाइल सुरक्षित करे, कच्चे स्ट्रिंग व `base64_encode` की एन्कोडेंग देकर भी PNG प्रदर्शित कर सकते हैं।
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Make me into an QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## सहायक
|
||||
|
||||
#### सहायक क्या है ?
|
||||
|
||||
सहायक QrCode का निर्माण करने का साधारण तरीका है जो स्कैन करने पर पाठक से निश्चित कार्रवाई करवाते हैं।
|
||||
|
||||
#### E-Mail (ई-मेल)
|
||||
|
||||
यह सहायक ई-मेल qrcode का निर्माण करता है जो ई-मेल का पता, विषय तथा शरीर भरने मे सक्षम होता है।
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//Fills in the to address
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//Fills in the to address, subject, and body of an e-mail.
|
||||
QrCode::email('foo@bar.com', 'This is the subject.', 'This is the message body.');
|
||||
|
||||
//Fills in just the subject and body of an e-mail.
|
||||
QrCode::email(null, 'This is the subject.', 'This is the message body.');
|
||||
|
||||
#### Geo (जियो)
|
||||
|
||||
यह सहायक अक्षांश व देशान्तर का निर्माण करता है जिसे फोन पढ़ व Google Maps (गूगल मांचित्र) या अन्य app मे खोल सकता है।
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Phone Number (फ़ोन नंबर)
|
||||
|
||||
इस सहायक द्वारा उत्तपन्न qrCode स्कैन करने पर नंबर डायल किया जा सकता है।
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (पाठ संदेश)
|
||||
|
||||
इस सहायक द्वारा उत्तपन्न QrCode स्कैन करने पर SMS संदेश का भेजने का पता तथा संदेश का शरीर पहले से भरा जा सकता है।
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//Creates a text message with the number filled in.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//Creates a text message with the number and message filled in.
|
||||
QrCode::SMS('555-555-5555', 'Body of the message');
|
||||
|
||||
#### Wi-Fi (वाई-फाई)
|
||||
|
||||
इस सहायक द्वारा उत्तपन्न qrCode स्कैन करने पर वाईफाई नेटवर्क से जुड़ा जा सकता है।
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID of the network',
|
||||
'password' => 'Password of the network',
|
||||
'hidden' => 'Whether the network is a hidden SSID or not.'
|
||||
]);
|
||||
|
||||
//Connects to an open WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
]);
|
||||
|
||||
//Connects to an open, hidden WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//Connects to an secured, WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'myPassword'
|
||||
]);
|
||||
|
||||
>वाई-फाई स्कैनिंग Apple उत्पादों में अभी समर्थित नही है।
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
## साधारण QrCode उपयोग
|
||||
|
||||
आप निम्न तालिका मे से `generate` अनुभाग मे पाए गये उपसर्ग का उपयोग करके और अधिक उन्नत जानकारी स्टोर करने के लिए QrCode का निर्माण कर सकते हैं:
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| प्रयोग | उपसर्ग | उदाहरण |
|
||||
| --- | --- | --- |
|
||||
| Website URL | http:// | http://www.simplesoftware.io |
|
||||
| Secured URL | https:// | https://www.simplesoftware.io |
|
||||
| E-mail Address | mailto: | mailto:support@simplesoftware.io |
|
||||
| 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; |
|
||||
| VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
## लरावेल(Laravel) के बाहर उपयोग
|
||||
|
||||
आप `BaconQrCodeGenerator` नमक नयी कक्षा स्थापित करके इस पैकेज का लरावेल के बाहर भी उपयोग कर सकते हैं।
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Make a qrcode without Laravel!');
|
||||
BIN
vendor/simplesoftwareio/simple-qrcode/docs/imgs/merged-qrcode.png
vendored
Normal file
BIN
vendor/simplesoftwareio/simple-qrcode/docs/imgs/merged-qrcode.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
348
vendor/simplesoftwareio/simple-qrcode/docs/it/README.md
vendored
Normal file
348
vendor/simplesoftwareio/simple-qrcode/docs/it/README.md
vendored
Normal file
@@ -0,0 +1,348 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [Introduzione](#docs-introduction)
|
||||
- [Traduzioni](#docs-translations)
|
||||
- [Configurazione](#docs-configuration)
|
||||
- [Semplici Utilizzi](#docs-ideas)
|
||||
- [Utilizzo](#docs-usage)
|
||||
- [Helpers](#docs-helpers)
|
||||
- [Uso generico dei QrCode](#docs-common-usage)
|
||||
- [Uso al di fuori di Laravel](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## Introduzione
|
||||
Simple QrCode è un semplice wrapper per il popolare framework Laravel basato sul bellissimo lavoro [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). Abbiamo creato un'interfaccia familiare e semplice da installare per gli utenti Laravel.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Traduzioni
|
||||
Siamo alla ricerca di utenti che ci aiutino a tradurre la documentazione in Arabo, Spagnolo, Francese, Coreano o Giapponese. Se pensate di potercela fare non esitate a fare una pull request!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Configurazione
|
||||
|
||||
#### Composer
|
||||
|
||||
Per prima cosa, aggiungete il pacchetto di Simple QrCode al file `require` in `composer.json`:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Ora lanciate il comando `composer update`.
|
||||
|
||||
#### Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Registrate `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` nel vostro `config/app.php` all'interno dell'array `providers`.
|
||||
|
||||
#### Alias
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Infine, registrate `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` nel vostro file di configurazione `config/app.php` all'interno dell'array `aliases`.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Semplici Utilizzi
|
||||
|
||||
#### Print View
|
||||
|
||||
Uno degli usi principali di questo pacchetto è la possibilità di avere codici Qr in tutte le nostre print views. Questo permette all'utente di tornare alla pagina originale semplicemente facendo lo scan del codice. Tutto ciò è possibile aggiungendo le seguenti linee nel nostro footer.blade.php.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Scansionami per tornare alla pagina principale.</p>
|
||||
</div>
|
||||
|
||||
#### Incorporare un QrCode
|
||||
|
||||
Potreste incorporare un codice Qr in una e-mail per permettere agli utenti uno scan immediato. Il seguente è un esempio di come potresti fare tutto ciò con Laravel.
|
||||
|
||||
//Inside of a blade template.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Incorporami in una e-mail!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## Utilizzo
|
||||
|
||||
#### Utilizzo Base
|
||||
|
||||
Usare il generatori di codici Qr è molto semplice. La sintassi più semplice è:
|
||||
|
||||
QrCode::generate('Trasformami in un QrCode!');
|
||||
|
||||
Questo comando produrrà un codice Qr che dice "Trasformami in un QrCode!"
|
||||
|
||||
#### Generate
|
||||
|
||||
`Generate` è usato per creare codici Qr:
|
||||
|
||||
QrCode::generate('Trasformami in un QrCode!');
|
||||
|
||||
>Attenzione! Questo metodo deve essere chiamato per ultimo se lo si usa all'interno di una catena (chain).
|
||||
|
||||
`Generate` restituirà, di default, una stringa di immagini SVG. Puoi stamparla direttamente in un browser recente dal sistema Blade di Laravel con il seguente codice:
|
||||
|
||||
{!! QrCode::generate('Make me into a QrCode!'); !!}
|
||||
|
||||
Il metodo `generate` accetta un secondo parametro che indica la directory nella quale verrà salvato il codice Qr.
|
||||
|
||||
QrCode::generate('Make me into a QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Variazione del formato
|
||||
|
||||
>QrCode Generator è impostato di default per generare immagini SVG.
|
||||
|
||||
>Attenzione! Il metodo `format` deve essere chiamato prima di qualunque altra opzione di formato come `size`, `color`, `backgroundColor`, o `margin`.
|
||||
|
||||
Momentaneamente, sono supportati tre formati: PNG, EPS e SVG. Per cambiare il formato usare uno dei seguenti comandi:
|
||||
|
||||
QrCode::format('png'); //Genererà un'immagine PNG
|
||||
QrCode::format('eps'); //Genererà un'immagine EPS
|
||||
QrCode::format('svg'); //Genererà un'immagine SVG
|
||||
|
||||
#### Variazione della grandezza
|
||||
|
||||
>QrCode Generator restituirà, di default, la più piccola grandezza possibile per creare il QrCode.
|
||||
|
||||
Puoi cambiare la grandezza del codice Qr usando il metodo `size`. Basta specificare la grandezza desiderata, in pixel, usando la seguente sintassi:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Variazione del colore
|
||||
|
||||
>Fai attenzione quando cambi il colore di un QrCode! Alcuni lettori potrebbero avere dei problemi a leggere dei codici Qr colorati diversamente.
|
||||
|
||||
Tutti i colori dovranno essere espressi in RGB (Rosso Verde Blu). Puoi cambiare il colore di un QrCode usando questa sintassi:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
Puoi anche cambiare il colore di sfondo con la seguente istruzione:
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Variazione del margine
|
||||
|
||||
E' anche possibile variare il margine attorno al codice Qr. Basta infatti specificare la grandezza del margine nella seguente sintassi:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Correzione dell'errore
|
||||
|
||||
Cambiare il livello di correzione dell'errore è facile. Per farlo, usare questa sintassi:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
Seguono le opzioni supportate dal metodo `errorCorrection`.
|
||||
|
||||
| Error Correction | Assurance Provided |
|
||||
| --- | --- |
|
||||
| L | 7% of codewords can be restored. |
|
||||
| M | 15% of codewords can be restored. |
|
||||
| Q | 25% of codewords can be restored. |
|
||||
| H | 30% of codewords can be restored. |
|
||||
|
||||
>Più error correction viene usata, più sarà grande il QrCode e meno dati sarà in grando di contenere. Leggi di più a riguardo [error correction](http://en.wikipedia.org/wiki/QR_code#Error_correction).
|
||||
|
||||
#### Encoding
|
||||
|
||||
Puoi cambiare l'encoding dei caratteri utilizzato per creare il codice Qr. Di default è selezionato `ISO-8859-1`. Leggi di più a riguardo [character encoding](http://en.wikipedia.org/wiki/Character_encoding)
|
||||
Puoi cambiare l'encoding utilizzando:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Trasformami in un QrCode con simboli speciali ??!!');
|
||||
|
||||
| Encoder dei caratteri |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>L'errore `Could not encode content to ISO-8859-1` significa che si sta usando l'encoding erraro. E' raccomandato usare `UTF-8` se non si è sicuri.
|
||||
|
||||
#### Merge
|
||||
|
||||
Il metodo `merge` unisce un immagine con un QrCode. Il merge è molto usato per inserire loghi in un codice Qr.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//Genera un QrCode con una immagine al centro.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//Genera un QrCode con una immagine al centro. L'immagine inserita occupa il 30% del codice Qr.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//Genera un QrCode con una immagine al centro. L'immagine inserita occupa il 30% del codice Qr.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>Il metodo `merge` supporta solamente il formato PNG.
|
||||
>Il percorso specificato è relativo alla base path se `$absolute` è impostata su `false`. Cambiare questa variabile in `true` per utilizzare percorsi assoluti.
|
||||
|
||||
>Dovresti usare un alto livello di error correction quando usi il metodo `merge` per assicurarti che il Qr sia ancora leggibile. Raccomandiamo di usare `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Merge Binary String
|
||||
|
||||
Il metodo `mergeString` può essere usato per ottenere quasi lo stesso risultato di `merge`, con la differenza che permette di inserire una rappresentazione testuale del file al posto del percorso. Questo è utile quando si lavora con la facade `Storage`. La sua interfaccia è molto simile a quella di `merge`.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//Genera un QrCode con una immagine al centro.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//Genera un QrCode con una immagine al centro. L'immagine inserita occupa il 30% del codice Qr.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
>Come la chiamata a `merge`, anche questa volta è supportato solamente il formato PNG. Lo stesso vale per gli error correction, H è il valore raccomandato.
|
||||
|
||||
#### Utilizzo Avanzato
|
||||
|
||||
Tutti i metodi supportano il chaining. Il metodo `generate` deve essere chiamato per ultimo e tutti gli eventuali metodi `format` devono essere chiamati per primi. Per esempio sono validi i seguenti:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Trasformami in un QrCode!');
|
||||
|
||||
Puoi mostrare un'immagine PNG senza salvare il file relativo impostando una stringa e scegliendo l'encoding `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Trasformami in un QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Helpers
|
||||
|
||||
#### Cosa sono gli helpers?
|
||||
|
||||
Gli Helpers sono un metodo molto semplice per creare codici Qr che permettono al lettore di eseguire una certa azione quando scansionati.
|
||||
|
||||
#### E-Mail
|
||||
|
||||
Questo helper genera un QrCode in grado di riempire i campi di una e-mail quali indirizzo, oggetto e corpo.
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//Fills in the to address
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//Fills in the to address, subject, and body of an e-mail.
|
||||
QrCode::email('foo@bar.com', 'Questo è l'oggetto.', 'Questo è il corpo del messaggio.');
|
||||
|
||||
//Fills in just the subject and body of an e-mail.
|
||||
QrCode::email(null, 'Questo è l'oggetto.', 'Questo è il corpo del messaggio.');
|
||||
|
||||
#### Geo
|
||||
|
||||
Questo helper genera una latitudine e una longitudine che un telefono può leggere ed aprire con Google Maps o applicazioni simili.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Numeri di Telefono
|
||||
|
||||
Questo helper genera un QrCode che, una volta scansionato, digita un numero di telefono.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (Messaggi)
|
||||
|
||||
Questo helper crea messaggi SMS che possono essere precompilati con il destinatario e il corpo del messaggio.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//Creates a text message with the number filled in.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//Creates a text message with the number and message filled in.
|
||||
QrCode::SMS('555-555-5555', 'Corpo del messaggio.');
|
||||
|
||||
#### WiFi
|
||||
|
||||
Questo helper crea codici Qr scansionabili che permettono la connessione del telefono ad una determinata rete WiFi.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID della rete',
|
||||
'password' => 'Password della rete',
|
||||
'hidden' => 'Whether the network is a hidden SSID or not.'
|
||||
]);
|
||||
|
||||
//Connects to an open WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nome Rete',
|
||||
]);
|
||||
|
||||
//Connects to an open, hidden WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nome Rete',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//Connects to an secured, WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Nome Rete',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'miaPassword'
|
||||
]);
|
||||
|
||||
>La scansione WiFi non è al momento supportata sui dispositivi Apple.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
##Uso generico dei QrCode
|
||||
|
||||
Puoi utilizzare un prefisso della tabella sottostante per generare dei codici Qr in grado di contenere maggiori informazioni:
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| 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 |
|
||||
| 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; |
|
||||
| VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
##Uso al di fuori di Laravel
|
||||
|
||||
Puoi usare questo package al di fuori di Laravel istanziando una nuova classe `BaconQrCodeGenerator`.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Crea un QrCode senza Laravel!');
|
||||
347
vendor/simplesoftwareio/simple-qrcode/docs/pt-br/README.md
vendored
Normal file
347
vendor/simplesoftwareio/simple-qrcode/docs/pt-br/README.md
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [Introdução](#docs-introduction)
|
||||
- [Traduções](#docs-translations)
|
||||
- [Configuração](#docs-configuration)
|
||||
- [Simples ideias](#docs-ideas)
|
||||
- [Uso](#docs-usage)
|
||||
- [Helpers](#docs-helpers)
|
||||
- [Uso comum do QrCode](#docs-common-usage)
|
||||
- [Uso sem Laravel](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## Introdução
|
||||
Simple QrCode é wrapper de fácil uso do Framework Laravel, baseado no grande trabalho provide pelo [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). Criamos uma interface que é fácil e familiar de instalar para usuários Laravel.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Traduções
|
||||
Estamos procurando por usuário que falem Árabe, Espanhol, Francês, Coreano ou Japonês, para nos ajudar a traduzir este documento. Por favor, crie um pull request if você é capar de fazer uma tradução!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Configuração
|
||||
|
||||
#### Composer
|
||||
|
||||
Primeiramente, adicione o pacote Simple QrCode ao seu `require` no arquivo `composer.json`:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Próximo, execute o comando `composer update`.
|
||||
|
||||
#### Provedor de Serviço
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Registre a `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` em seu `config/app.php` dentro do array `providers`.
|
||||
|
||||
#### Aliases
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Finally, register the `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` em seu arquivo de configuração `config/app.php` dentro do array `aliases`.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Simple Ideas
|
||||
|
||||
#### Print View
|
||||
|
||||
Um dos principais itens que utilizam este pacote para é ter QRCodes em todos os nossos pontos de vista de impressão. Isto permite que nossos clientes para retornar para a página original depois de impresso, basta digitalizar o código. Conseguimos isso adicionando o seguinte em nosso arquivo footer.blade.php.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Scan me to return to the original page.</p>
|
||||
</div>
|
||||
|
||||
#### Embarcando um QrCode
|
||||
|
||||
Você pode incorporar um qrcode dentro de um e-mail, que permita que seus usuários escaneiem rapidamente. Abaixo, um exemplo de como fazer isso utilizando o Laravel.
|
||||
|
||||
//Inside of a blade template.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Embed me into an e-mail!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## Uso
|
||||
|
||||
#### Uso Básico
|
||||
|
||||
É muito fácil utilizar o gerador de Qrcode. A sintaxe mais básica é:
|
||||
|
||||
QrCode::generate('Me transforme em um QrCode!');
|
||||
|
||||
Isso criará um Qr que diz "Me transforme em um QrCode!"
|
||||
|
||||
#### Generate
|
||||
|
||||
`Generate` é usado para criar o QrCode.
|
||||
|
||||
QrCode::generate('Me transforme em um QrCode!');
|
||||
|
||||
>Atenção! Esse método deve ser chamado por último dentro da cadeia.
|
||||
|
||||
`Generate` por padrão irá retornar uma string de imagem SVG. Você pode exibir diretamente em seu browser, utilizando o Laravel's Blade com o código abaixo:
|
||||
|
||||
{!! QrCode::generate('Me transforme em um QrCode!'); !!}
|
||||
|
||||
O método `generate` tem um segundo parametro que aceita um arquivo e um path para salvar o Qrcode.
|
||||
|
||||
QrCode::generate('Me transforme em um QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Alteração de Formato
|
||||
|
||||
>Por padrão o gerador de QrCode está configurado para retornar uma imagem SVG.
|
||||
|
||||
>Cuidao! O método `format` deve ser chamado antes de qualquer outra opção de formatação como `size`, `color`, `backgroundColor` e `margin`.
|
||||
|
||||
Atualmente são suportados três tipos de formatos; PNG, EPS, and SVG. Para alterar o formato, use o seguinte código:
|
||||
|
||||
QrCode::format('png'); //Retornará uma imagem no formato PNG
|
||||
QrCode::format('eps'); //Retornará uma imagem no formato EPS
|
||||
QrCode::format('svg'); //Retornará uma imagem no formato SVG
|
||||
|
||||
#### Alteração de Tamanho
|
||||
|
||||
>Por padrão, o gerador QrCode retornará o menos tamanho possível em pixels para criar o QrCode.
|
||||
|
||||
Você pode alterar o tamanho do QrCode usando o método `size`. Simplesmente especificando o tamanho desejado em pixels usando a seguinte sintaze:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Alteração de cor
|
||||
|
||||
>Cuidado quando estiver alterando a cor de um QRCode. Alguns leitores tem uma grande dificuldade em ler QrCodes coloridos.
|
||||
|
||||
Todas as cores devem ser definidas em RGB(Red Green Blue). Você pode alterar a cor de um qrCode usando o código abaixo. You can change the color of a QrCode by using the following:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
Alterações do plano de fundo também são suportadas e definidas da mesma maneira.
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Alteração de Margem
|
||||
|
||||
A capacidade de alterar a margem ao redor do QrCode também é suportada. Simplesmente especifique o tamenho desejado da margem, utilizando a sintaxe abaixo:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Correção de erros
|
||||
|
||||
Alterar o nível de correção de erros é simples. Utilize a seguinte sintaxe:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
As seguintes opções são suportadas para o método `errorCorrection`.
|
||||
|
||||
| Error Correction | Assurance Provided |
|
||||
| --- | --- |
|
||||
| L | 7% of codewords can be restored. |
|
||||
| M | 15% of codewords can be restored. |
|
||||
| Q | 25% of codewords can be restored. |
|
||||
| H | 30% of codewords can be restored. |
|
||||
|
||||
>The more error correction used; the bigger the QrCode becomes and the less data it can store. Read more about [error correction](http://en.wikipedia.org/wiki/QR_code#Error_correction).
|
||||
|
||||
#### Codificação
|
||||
|
||||
Alterar a codificação que é usada para criar um QrCode. Por padrão, a encodificação padrão é a `ISO-8859-1`. Leia mais sobre [character encoding](https://pt.wikipedia.org/wiki/Codifica%C3%A7%C3%A3o_de_caracteres) Você pode alterar a codificação usando o seguinte código:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Make me a QrCode with special symbols ♠♥!!');
|
||||
|
||||
| Character Encoder |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
>Um erro de `Could not encode content to ISO-8859-1` significa que foi inserido algum caractere inválido. Recomendamos o `UTF-8` se você não tiver certeza.
|
||||
|
||||
#### Mesclar
|
||||
|
||||
O método `merge` mescla uma imagem sobre um Qrcode. É comumente usado para se colocar logos dentro de um QrCode.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//Gera um QrCode com uma imagem centralizada.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//Gera um QrCode com uma imagem centralizada. A imagem inserida ocupará 30% do QrCode.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//Gera um QrCode com uma imagem centralizada. A imagem inserida ocupará 30% do QrCode.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
>O método `merge` suporta somente arquivos do tipo PNG.
|
||||
>O filepath é relativo ao caminho base da aplicação, se o `$absolute` estiver setada para `false`. Altere essa variável para `true` para usar caminhos absolutos.
|
||||
|
||||
>Você deve usar um alto nível de correção de erros quando usado o método `merge`, para garantir que o QrCode será legível. Recomendamos usar `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Merge Binary String
|
||||
|
||||
O método `mergeString` pode ser usado para alcaçar a mesma chamada do método `merge`, exceto que ele permite que você represente uma string de um arquivo ao invés do filepath. Isso é útil quando é utilizado o padrão `Storage` . A chamada a essa interface é bastante similar ao método `merge`.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//Gera um QrCode com uma imagem centralizada.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//Gera um QrCode com uma imagem centralizada. A imagem inserida ocupará 30% do QrCode.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
>Assim como o método `merge`, somente arquivos do tipo PNG são suportados. O mesmo aplica-se para correção de erros, altos níveis são recomendados.
|
||||
|
||||
#### Uso Avançado
|
||||
|
||||
Todos os métodos suportam encadeamento. O método `generate` deve ser chamado por ultimo e o método `format` deve ser chamado primeiro. Por exemplo, vocẽ pode executar o código seguinte:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Make me a QrCode!');
|
||||
|
||||
Você pode exibir uma imagem PNG, sem salvar o arquivo e prover uma string encodificada pelo método `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Make me into an QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Ajudantes
|
||||
|
||||
#### O que são ajudantes?
|
||||
|
||||
Ajudantes são uma maneira fácil de criar QrCodes que executam uma ação quando escaneados.
|
||||
|
||||
#### E-Mail
|
||||
|
||||
Esse helper, gera um qrcode de e-mail que é capaz de ser preenchido no endereço de e-mail, assunto e corpo.
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//Fills in the to address
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//Fills in the to address, subject, and body of an e-mail.
|
||||
QrCode::email('foo@bar.com', 'This is the subject.', 'This is the message body.');
|
||||
|
||||
//Fills in just the subject and body of an e-mail.
|
||||
QrCode::email(null, 'This is the subject.', 'This is the message body.');
|
||||
|
||||
#### Geo
|
||||
|
||||
Esse helper gera uma latitude e longituded que o pode ser lido por um aparelho celular e abrir a localização no Google maps ou outro aplicativo similar.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Phone Number
|
||||
|
||||
Esse helper, gera uma QrCode que pode ser escaneado exibido um telefone.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### SMS (Mensagens de Texto)
|
||||
|
||||
Esse Helper, cria uma mensagem SMS que pode ser This helper makes SMS messages that can be preenchida com o emissoe e o corpo da mensagem.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//Cria uma mensagem de texto com o telefone preenchido.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//Cria uma mensagem de text com o numero telefonico e a mensagem preenchida.
|
||||
QrCode::SMS('555-555-5555', 'Body of the message');
|
||||
|
||||
#### WiFi
|
||||
|
||||
Esse Helper, faz com que QrCodes escaneaveis, permitam o aparelho celular se conectar a uma rede WI-FI.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'SSID of the network',
|
||||
'password' => 'Password of the network',
|
||||
'hidden' => 'Whether the network is a hidden SSID or not.'
|
||||
]);
|
||||
|
||||
//Connects to an open WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
]);
|
||||
|
||||
//Connects to an open, hidden WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//Connects to an secured, WiFi network.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Network Name',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'myPassword'
|
||||
]);
|
||||
|
||||
>Escaneamento WIFI atualmente não são suportados nos produtos Apple.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
##Uso Comum do QRCode
|
||||
|
||||
Você pode usar um prefixo listado na tabela abaixo dentro da seção `generate` para criar um QrCode para armazenar informações mais avançadas:
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| 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 |
|
||||
| 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; |
|
||||
| VCard | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
##Uso fora do Laravel
|
||||
|
||||
Você pode usar o pacote fora do Laravel instanciando a classe `BaconQrCodeGenerator`.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Make a qrcode without Laravel!');
|
||||
347
vendor/simplesoftwareio/simple-qrcode/docs/ru/README.md
vendored
Normal file
347
vendor/simplesoftwareio/simple-qrcode/docs/ru/README.md
vendored
Normal file
@@ -0,0 +1,347 @@
|
||||
Простой QR-код
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [Введение](#docs-introduction)
|
||||
- [Переводы](#docs-translations)
|
||||
- [Конфигурация](#docs-configuration)
|
||||
- [Простые Идеи](#docs-ideas)
|
||||
- [Употребление](#docs-usage)
|
||||
- [Хелперы](#docs-helpers)
|
||||
- [Распространенное использование QR-кода](#docs-common-usage)
|
||||
- [Использование за пределами Laravel](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## Введение
|
||||
Обычный QR-код простой в использовании обертки для популярных рамок Laravel на основе превосходный работы, предоставленной [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode). Мы создали интерфейс, который привычный и простой в установке для пользователей Laravel.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## Переводы
|
||||
Мы ищем пользователей, говорящих на китайском, корейском или японском языках, которые могут помочь перевести этот документ. Пожалуйста, создайте пул реквест, если вы способны сделать перевод!
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## Конфигурация
|
||||
|
||||
#### Composer
|
||||
|
||||
Во-первых, добавьте пакет простого QR-код к `require` в файле `composer.json`:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
Затем запустите команду `composer update`.
|
||||
|
||||
#### Поставщик Услуг
|
||||
|
||||
###### Laravel <= 5.4
|
||||
Зарегистрируйте `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` в `config/app.php` в пределах массива `providers`.
|
||||
|
||||
#### Псевдонимы
|
||||
|
||||
###### Laravel <= 5.4
|
||||
В конце, зарегистрируйте `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` в `config/app.php` файл конфигурации в пределах массива `aliases`.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## Простые Идеи
|
||||
|
||||
#### Предварительный Просмотр Печати
|
||||
|
||||
Иметь QR-код во всех предварительных просмотрах является одним из основных элементов, для которых мы используем этот пакет. Это позволяет нашим клиентам, вернуться на исходную страницу после того, как она будет напечатана с помощью сканирования кода. Мы добились этого, добавив footer.blade.php в наш файл.
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Сканируйте меня, чтобы вернуться на исходную страницу.</p>
|
||||
</div>
|
||||
|
||||
#### Вставление QR-код
|
||||
|
||||
Вы можете вставить QR-код в электронную почту, чтобы позволить пользователям быстро его сканировать. Ниже приведен пример того, как сделать это с помощью Laravel.
|
||||
|
||||
// Внутри шаблона Blade.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Введете меня в сообщение по электронный почте!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## Употребление
|
||||
|
||||
#### Основное Использование
|
||||
|
||||
Использовать генератор для QR-код очень легко. Самый основной синтаксис:
|
||||
|
||||
QrCode::generate('Сделайте меня QR-кодом!');
|
||||
|
||||
Это создаст QR-код говоря "Сделайте меня QR-кодом!"
|
||||
|
||||
#### Генератора
|
||||
|
||||
`Generate` используется, чтобы создать QR-код.
|
||||
|
||||
QrCode::generate('Сделайте меня QR-кодом!');
|
||||
|
||||
> Внимание! Этот метод должен быть вызван в конце если используются в последовательности.
|
||||
|
||||
`Generate` по умолчанию возвращает строку изображение в формате SVG. Вы можете напечатать это прямо в современный браузер внутри системы Blade в Laravel как указано далее:
|
||||
|
||||
{!! QrCode::generate('Сделайте меня QR-кодом!'); !!}
|
||||
|
||||
Метод `generate` имеет второй параметр, который будет принимать имя файла и путь для сохранения QR-код.
|
||||
|
||||
QrCode::generate('Сделайте меня QR-кодом!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### Изменение Формата
|
||||
|
||||
> Генератор QR-код установлен для возврата изображения в формате SVG по умолчанию.
|
||||
|
||||
> Будьте осторожны! Метод `format` должен вызываться перед всеми остальными параметрами форматирования, такими как: `size`, `color`, `backgroundColor`, и `margin`.
|
||||
|
||||
Три формата на данный момент поддерживаются; PNG, EPS, и SVG. Для изменения формата используйте следующий код:
|
||||
|
||||
QrCode::format('png'); // Возвращает изображение в формате PNG
|
||||
QrCode::format('eps'); // Возвращает изображение в формате EPS
|
||||
QrCode::format('svg'); // Возвращает изображение в формате SVG
|
||||
|
||||
#### Изменение Размера
|
||||
|
||||
> Генератор QR-код по умолчанию будет возвращать наименьший размер в пикселях возможных для создания QR-код.
|
||||
|
||||
Вы можете изменить размер QR-код с помощью метода `size`. Просто укажите размер желаемого в пикселях, используя следующий синтаксис:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### Изменение цвета
|
||||
|
||||
> Будьте осторожны при изменении цвета в QR-код. Некоторым читателям очень сложно читать QR-код в цвете.
|
||||
|
||||
Все QR-коды должны быть выражены в красном, зеленом или синем цвете. Вы можете изменить цвет QR-код с помощью следующих действий:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
Изменения цвета фона также поддерживаются и должны быть выражены таким же образом.
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### Изменение поля
|
||||
|
||||
Возможность изменения поля вокруг QR-кода также поддерживается. Просто укажите желаемый запас, используя следующий синтаксис:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### Исправление ошибок
|
||||
|
||||
Изменять уровень коррекции ошибок легко. Просто используйте следующий синтаксис:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
Указанное далее поддерживается в вариантах для метода `errorCorrection`.
|
||||
|
||||
| Исправление ошибок | Гарантия |
|
||||
| --- | --- |
|
||||
| L | 7% кодовых слов могут быть восстановлены.|
|
||||
| M | 15% кодовых слов могут быть восстановлены.|
|
||||
| Q | 25% кодовых слов могут быть восстановлены.|
|
||||
| H | 30% кодовых слов могут быть восстановлены.|
|
||||
|
||||
> Чем больше коррекций ошибок используется; тем больше становится QR-код и тем меньше данных он может хранить. Подробнее читайте об [исправлении ошибок]( https://ru.wikipedia.org/wiki/QR-%D0%BA%D0%BE%D0%B4#.D0.9E.D0.B1.D1.89.D0.B0.D1.8F_.D1.82.D0.B5.D1.85.D0.BD.D0.B8.D1.87.D0.B5.D1.81.D0.BA.D0.B0.D1.8F_.D0.B8.D0.BD.D1.84.D0.BE.D1.80.D0.BC.D0.B0.D1.86.D0.B8.D1.8F).
|
||||
|
||||
#### Кодирование
|
||||
|
||||
Измените кодировку,которая используется для создания QR-кода. По умолчанию `ISO-8859-1` выбран в качестве кодера. Подробнее читайте о [кодирование символов]( https://ru.wikipedia.org/wiki/%D0%9D%D0%B0%D0%B1%D0%BE%D1%80_%D1%81%D0%B8%D0%BC%D0%B2%D0%BE%D0%BB%D0%BE%D0%B2). Вы можете изменить это на любое из следующих действий:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('‘Сделайте меня QR-кодом со специальными символами ♠♥!!');
|
||||
|
||||
| Набор Символов |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
> Ошибка обозначена `Could not encode content to ISO-8859-1` означает, что неправильный тип кодировки был использован. Мы рекомендуем `UTF-8` если вы не уверены.
|
||||
|
||||
#### Merge
|
||||
|
||||
Метод `merge` объединяет изображение над QR-кодом. Это обычно используется для логотипов, размещенных в пределах QR-кода.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
// Создает QR-код с изображением в центре.
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
// Создает QR-код с изображением в центре. Вставленное изображение занимает 30% QR-кода.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
// Создает QR-код с изображением в центре. Вставленное изображение занимает 30% QR-кода.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
> Метод `merge` поддерживает только формат PNG в это время.
|
||||
> Путь к файлу является относительно базового приложения пути, если `$absolute` установлен к `false`. Измените эту переменную `true` чтоб использовать абсолютные пути.
|
||||
|
||||
> Вы должны использовать высокий уровень коррекции ошибок при использовании метода `merge` чтобы гарантировать, что QR-код остается читаемым. Мы рекомендуем использовать `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### Слияние Двоичной Строки
|
||||
|
||||
Метод `mergeString` может быть использован для достижения такой же, как вызов `merge` за исключением того, что позволяет обеспечить строковое представление файла вместо пути к файлу. Это полезно при работе с фасадом `Storage`. Этот интерфейс очень похож на вызов `merge`.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
// Создает QR-код с изображением в центре.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
// Создает QR-код с изображением в центре. Вставленное изображение занимает 30% QR-кода.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
> Как и в случае нормального вызова `merge` только PNG поддерживается в это время. То же самое относится к коррекции ошибок, рекомендуется использовать высокие уровни.
|
||||
|
||||
#### Дополнительные Функции
|
||||
|
||||
Все методы поддержки формирование последовательности. Метод `generate` должен быть вызван последним и любое изменение формата должно быть вызвано в первую очередь. Например, вы можете запустить любое из следующих действий:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Сделайте меня QR-кодом!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Сделайте меня QR-кодом!');
|
||||
|
||||
Вы можете отобразить изображение в формате PNG без сохранения файла, предоставляя необработанную строку и кодирование с `base64_encode`.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Сделайте меня QR-кодом!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## Хелперы
|
||||
|
||||
#### Что такое хелперы?
|
||||
|
||||
Хелперы позволяют простой способ для создания QR-код, которые заставляют читателя выполнить определенное действие при сканировании.
|
||||
|
||||
#### Электронная Почта
|
||||
|
||||
Этот хелпер генерирует QR-код для электронный почты, который в состоянии заполнить адрес электронной почты, тему и текст.
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
// Заполняет адресата
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
// Заполняет адресата, тему и текст сообщения электронной почты.
|
||||
QrCode::email('foo@bar.com', 'Это тема.', 'Это текст.');
|
||||
|
||||
// Заполняет только тему и текст сообщения электронной почты.
|
||||
QrCode::email(null, 'Это тема.', 'Это текст.');
|
||||
|
||||
#### Geo
|
||||
|
||||
Этот хелпер генерирует широту и долготу, так что телефон может читать и открыть местоположение в Google Maps или подобного приложения.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### Номер телефона
|
||||
|
||||
Этот хелпер генерирует QR-код, который можно сканировать, а затем набирает номер.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### СМС(текстовые сообщения)
|
||||
|
||||
Этот хелпер создаёт СМС сообщения, которые могут быть уже заполнены с адресом и текстом сообщения.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
// Создает СМС где номер телефона уже заполнен.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
// Создает СМС где номер и текст уже заполнены.
|
||||
QrCode::SMS('555-555-5555', 'текст сообщения.');
|
||||
|
||||
#### WiFi
|
||||
|
||||
Эти хелперы создают сканируемые QR-коды, которые могут подключить телефон к сети Wi-Fi.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => 'идентификатор сети (SSID)',
|
||||
'password' => 'пароль сети',
|
||||
'hidden' => 'Если SSID сети явлается скрытым.'
|
||||
]);
|
||||
|
||||
// Подключается к открытой сети WiFi.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Имя сети',
|
||||
]);
|
||||
|
||||
// Подключается к открытой, скрытой сети WiFi.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Имя сети',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
// Подключается к защищенной сети.
|
||||
QrCode::wiFi([
|
||||
'ssid' => 'Имя сети',
|
||||
'encryption' => 'WPA',
|
||||
'password' => ' Мой пароль'
|
||||
]);
|
||||
|
||||
> Сканирование WiFi в настоящее время не поддерживается на продукты Apple.
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
## Распространенное использование QR-кода
|
||||
|
||||
Вы можете использовать префикс, найденный в таблице ниже, в секции `generate` чтобы создать QR-код для хранения более расширенной информации:
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| Применение | Префикс | Пример |
|
||||
| --- | --- | --- |
|
||||
| Сылка на сайт | http:// | http://www.simplesoftware.io |
|
||||
| Обеспеченные URL | https:// | https://www.simplesoftware.io |
|
||||
| Адрес электронной почты | mailto: | mailto:support@simplesoftware.io |
|
||||
| Номер телефона| tel: | tel:555-555-5555 |
|
||||
| Текстовые сообщения (СМС) | sms: | sms:555-555-5555 |
|
||||
| Текстовые сообщения (СМС) с введенным сообщением | sms: | sms:: Я введенное сообщение |
|
||||
| Текстовые сообщения (СМС) с введенным сообщением и номером телефона | sms: | sms:555-555-5555: Я введенное сообщение |
|
||||
| Geo | geo: | geo:-78.400364,-85.916993 |
|
||||
| MeCard | mecard: | MECARD:Simple, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@simplesoftware.io; |
|
||||
| VCard | BEGIN:VCARD | [Примеры](https://ru.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
## Использование за пределами Laravel
|
||||
|
||||
Вы можете использовать этот пакет за пределами Laravel от инстанцировании нового класса `BaconQrCodeGenerator`.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Создайте QR-код без Laravel!');
|
||||
346
vendor/simplesoftwareio/simple-qrcode/docs/zh/README.md
vendored
Normal file
346
vendor/simplesoftwareio/simple-qrcode/docs/zh/README.md
vendored
Normal file
@@ -0,0 +1,346 @@
|
||||
Simple QrCode
|
||||
========================
|
||||
|
||||
[](https://travis-ci.org/SimpleSoftwareIO/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
[](https://packagist.org/packages/simplesoftwareio/simple-qrcode)
|
||||
|
||||
- [简介](#docs-introduction)
|
||||
- [翻译](#docs-translations)
|
||||
- [配置](#docs-configuration)
|
||||
- [简例](#docs-ideas)
|
||||
- [使用说明](#docs-usage)
|
||||
- [辅助用法](#docs-helpers)
|
||||
- [QrCode 常规用法](#docs-common-usage)
|
||||
- [在Laravel外的调用方式](#docs-outside-laravel)
|
||||
|
||||
<a id="docs-introduction"></a>
|
||||
## 简介
|
||||
Simple QrCode 是基于强大的[Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode)库开发的适用于当前最流行的Laravel框架的一个扩展库.便于Laravel用户可以很方便地使用.
|
||||
|
||||
<a id="docs-translations"></a>
|
||||
## 翻译
|
||||
我们在寻找可以将本文档翻译成韩语或日语的伙伴加入,将本文档翻译成当地语言.愿意翻译的朋友们欢迎pull给我.
|
||||
|
||||
<a id="docs-configuration"></a>
|
||||
## 配置
|
||||
|
||||
#### Composer 设置
|
||||
|
||||
首先,添加 QrCode 包添加到你的 `composer.json` 文件的 `require` 里:
|
||||
|
||||
"require": {
|
||||
"simplesoftwareio/simple-qrcode": "~2"
|
||||
}
|
||||
|
||||
然后,运行 `composer update` .
|
||||
|
||||
#### 添加 Service Provider
|
||||
|
||||
###### Laravel <= 5.4
|
||||
注册 `SimpleSoftwareIO\QrCode\QrCodeServiceProvider::class` 至 `config/app.php` 的 `providers` 数组里.
|
||||
|
||||
#### 添加 Aliases
|
||||
|
||||
###### Laravel <= 5.4
|
||||
最后,注册 `'QrCode' => SimpleSoftwareIO\QrCode\Facades\QrCode::class` 至 `config/app.php` 的 `aliases` 数组里.
|
||||
|
||||
<a id="docs-ideas"></a>
|
||||
## 简例
|
||||
|
||||
#### 打印视图
|
||||
|
||||
一个重要的应用是在打印页面添加的来源二维码.这里我们只需要在 footer.blade.php 文件里添加如下代码即可!
|
||||
|
||||
<div class="visible-print text-center">
|
||||
{!! QrCode::size(100)->generate(Request::url()); !!}
|
||||
<p>Scan me to return to the original page.</p>
|
||||
</div>
|
||||
|
||||
#### 嵌入二维码
|
||||
|
||||
你可以嵌入一个二维码在你的Email里,让收信的用户可以快速扫描.以下是使用 Laravel 实现的一个例子:
|
||||
|
||||
//Inside of a blade template.
|
||||
<img src="{!!$message->embedData(QrCode::format('png')->generate('Embed me into an e-mail!'), 'QrCode.png', 'image/png')!!}">
|
||||
|
||||
<a id="docs-usage"></a>
|
||||
## 使用说明
|
||||
|
||||
#### 基本使用
|
||||
使用QrCode的Generator非常方便. 多数情况下只要这样:
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
这就能创建一个内容是:"Make me into a QrCode!" 的二维码了.
|
||||
|
||||
#### 生成二维码
|
||||
|
||||
`Generate` 是用来创建二维码的方法.
|
||||
|
||||
QrCode::generate('Make me into a QrCode!');
|
||||
|
||||
>注意:要创建二维码必须使用此方法
|
||||
|
||||
`Generate` 默认返回一个 SVG 格式的图片文本. 你可以在Laravel 的 Blade 系统中把它显示到浏览器中,使用方式如下:
|
||||
|
||||
{!! QrCode::generate('Make me into a QrCode!'); !!}
|
||||
|
||||
`generate` 方法的第二个参数是指定要存储图片数据的文件地址.
|
||||
|
||||
QrCode::generate('Make me into a QrCode!', '../public/qrcodes/qrcode.svg');
|
||||
|
||||
#### 自己定义输出图片格式
|
||||
|
||||
>QrCode Generator 默认输出SVG格式的图片.
|
||||
|
||||
>注意! `format` 方法必须第一个被设置, 其它的设置如: `size`, `color`, `backgroundColor`, 和 `margin` 的设置必须在它的后边.
|
||||
|
||||
支持 PNG,EPS,SVG 三种格式,设置方式如下:
|
||||
|
||||
QrCode::format('png'); //Will return a PNG image
|
||||
QrCode::format('eps'); //Will return a EPS image
|
||||
QrCode::format('svg'); //Will return a SVG image
|
||||
|
||||
#### 尺寸设置
|
||||
|
||||
>QrCode 的 Generator 默认返回可能最小像素单位的二维码.
|
||||
|
||||
你可以使用 `size` 方法去设置它的尺寸.下方是设置像素尺寸的实例:
|
||||
|
||||
QrCode::size(100);
|
||||
|
||||
#### 颜色设置
|
||||
|
||||
>注意改变颜色后,可能会导致某些设备难以识别.
|
||||
|
||||
颜色设置的格式必须是RBG格式. 设置方式如下:
|
||||
|
||||
QrCode::color(255,0,255);
|
||||
|
||||
设置背景色的方法也是一样的:
|
||||
|
||||
QrCode::backgroundColor(255,255,0);
|
||||
|
||||
#### 边距设置
|
||||
|
||||
也支持设置边距. 设置方式如下:
|
||||
|
||||
QrCode::margin(100);
|
||||
|
||||
#### 容错级别设置
|
||||
|
||||
改变二维码的容错级别也很方便. 只要这么设置:
|
||||
|
||||
QrCode::errorCorrection('H');
|
||||
|
||||
下方是 `errorCorrection` 方法支持的容错级别设置.
|
||||
|
||||
| 容错级别 | 说明 |
|
||||
| --- | --- |
|
||||
| L | 7% 的字节码恢复率. |
|
||||
| M | 15% 的字节码恢复率. |
|
||||
| Q | 25% 的字节码恢复率. |
|
||||
| H | 30% 的字节码恢复率. |
|
||||
|
||||
>容错级别越高,二维码里能存储的数据越少. 详情见: [error correction](http://en.wikipedia.org/wiki/QR_code#Error_correction).
|
||||
|
||||
#### 编码
|
||||
|
||||
QrCode 创建二维码时可以使用不同的编码. 默认使用 `ISO-8859-1`. 详情见 [character encoding](http://en.wikipedia.org/wiki/Character_encoding) 你可以使用以下的任一种编码:
|
||||
|
||||
QrCode::encoding('UTF-8')->generate('Make me a QrCode with special symbols ♠♥!!');
|
||||
|
||||
| 编码 |
|
||||
| --- |
|
||||
| ISO-8859-1 |
|
||||
| ISO-8859-2 |
|
||||
| ISO-8859-3 |
|
||||
| ISO-8859-4 |
|
||||
| ISO-8859-5 |
|
||||
| ISO-8859-6 |
|
||||
| ISO-8859-7 |
|
||||
| ISO-8859-8 |
|
||||
| ISO-8859-9 |
|
||||
| ISO-8859-10 |
|
||||
| ISO-8859-11 |
|
||||
| ISO-8859-12 |
|
||||
| ISO-8859-13 |
|
||||
| ISO-8859-14 |
|
||||
| ISO-8859-15 |
|
||||
| ISO-8859-16 |
|
||||
| SHIFT-JIS |
|
||||
| WINDOWS-1250 |
|
||||
| WINDOWS-1251 |
|
||||
| WINDOWS-1252 |
|
||||
| WINDOWS-1256 |
|
||||
| UTF-16BE |
|
||||
| UTF-8 |
|
||||
| ASCII |
|
||||
| GBK |
|
||||
| EUC-KR |
|
||||
|
||||
> 若抛出 `Could not encode content to ISO-8859-1` 意味着使用了错误的编码. 我们建议你使用 `UTF-8`.
|
||||
|
||||
#### 加LOGO图
|
||||
|
||||
`merge` 方法可以让QrCode为生成结果加上LOGO图片. 下方是常见的为二维码加LOGO图片的使用方式.
|
||||
|
||||
QrCode::merge($filename, $percentage, $absolute);
|
||||
|
||||
//生成一个中间有LOGO图片的二维码
|
||||
QrCode::format('png')->merge('path-to-image.png')->generate();
|
||||
|
||||
//生成一个中间有LOGO图片的二维码,且LOGO图片占整个二维码图片的30%.
|
||||
QrCode::format('png')->merge('path-to-image.png', .3)->generate();
|
||||
|
||||
//使用绝对路径的LOGO图片地址创建二维码,LOGO图片占整个二维码图片的30%.
|
||||
QrCode::format('png')->merge('http://www.google.com/someimage.png', .3, true)->generate();
|
||||
|
||||
> `merge` 方法当前只支持PNG格式的图片
|
||||
> 默认使用相对于应用程序的根路径,把第三个参数设置为 `true` 就能切换到使用绝对路径
|
||||
|
||||
> 为了让二维码保持高可识别度,建议在使用 `merge` 方法时把二维码的容错级别提高. 我们默认使用: `errorCorrection('H')`.
|
||||
|
||||

|
||||
|
||||
#### 加二进制LOGO图片
|
||||
|
||||
`mergeString` 方法与 `merge` 方法类似, 不同的是它允许你使用一个二进制的String代替LOGO文件路径. 这在使用 `Storage` 存储时,会显得很方便. 它的参数与 `merge` 类似.
|
||||
|
||||
QrCode::mergeString(Storage::get('path/to/image.png'), $percentage);
|
||||
|
||||
//使用中间件读取的图片数据作为LOGO图片来创建二维码.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'))->generate();
|
||||
|
||||
//使用中间件读取的图片数据作为LOGO图片来创建二维码, 且LOGO图片占整个二维码图片的30%.
|
||||
QrCode::format('png')->mergeString(Storage::get('path/to/image.png'), .3)->generate();
|
||||
|
||||
> 和 `merge` 方法一样,当前只支持PNG格式. 同样建议将二维码的容错级别提高.
|
||||
|
||||
#### 高级用法
|
||||
|
||||
所有的方法都支持连贯操作. `generate` 方法必须在最后 `format` 必须在第一个. 例如:
|
||||
|
||||
QrCode::size(250)->color(150,90,10)->backgroundColor(10,14,244)->generate('Make me a QrCode!');
|
||||
QrCode::format('png')->size(399)->color(40,40,40)->generate('Make me a QrCode!');
|
||||
|
||||
你还能不存储图片,而使用 `base64_encode` 来将二进制数据直接显示成二维码图片.
|
||||
|
||||
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('Make me into an QrCode!')) !!} ">
|
||||
|
||||
<a id="docs-helpers"></a>
|
||||
## 辅助用法
|
||||
|
||||
#### 什么是辅助方法?
|
||||
|
||||
辅助方法是为了便于开发者在常见的二维码使用场景中更高效地使用本库.
|
||||
|
||||
#### E-Mail
|
||||
|
||||
这个辅助方法可以生成一个直接发E-mail的二维码.包含了发邮件的地址,标题,和内容
|
||||
|
||||
QrCode::email($to, $subject, $body);
|
||||
|
||||
//加入一个邮件地址
|
||||
QrCode::email('foo@bar.com');
|
||||
|
||||
//加一个邮件地址、标题、内容至二维码.
|
||||
QrCode::email('foo@bar.com', 'This is the subject.', 'This is the message body.');
|
||||
|
||||
//只加标题和内容.
|
||||
QrCode::email(null, 'This is the subject.', 'This is the message body.');
|
||||
|
||||
#### 位置
|
||||
|
||||
这个辅助方法能创建一个包含一个经纬度的位置二维码.
|
||||
|
||||
QrCode::geo($latitude, $longitude);
|
||||
|
||||
QrCode::geo(37.822214, -122.481769);
|
||||
|
||||
#### 手机号
|
||||
|
||||
这个辅助方法能创建一个包含自己手机号的二维码.
|
||||
|
||||
QrCode::phoneNumber($phoneNumber);
|
||||
|
||||
QrCode::phoneNumber('555-555-5555');
|
||||
QrCode::phoneNumber('1-800-Laravel');
|
||||
|
||||
#### 短信
|
||||
|
||||
这个辅助方法能创建能创建一个包含发送短信目标手机号和内容的二维码.
|
||||
|
||||
QrCode::SMS($phoneNumber, $message);
|
||||
|
||||
//创建一个只有手机号的短信二维码.
|
||||
QrCode::SMS('555-555-5555');
|
||||
|
||||
//创建一个包含手机号和文字内容的短信二维码.
|
||||
QrCode::SMS('555-555-5555', 'Body of the message');
|
||||
|
||||
#### WIFI
|
||||
|
||||
这个辅助方法能创建扫一下能连接WIFI的二维码.
|
||||
|
||||
QrCode::wiFi([
|
||||
'encryption' => 'WPA/WEP',
|
||||
'ssid' => '网络的SSID',
|
||||
'password' => '网络的密码',
|
||||
'hidden' => '是否是一个隐藏SSID的网络'
|
||||
]);
|
||||
|
||||
//连接一个开放的网络
|
||||
QrCode::wiFi([
|
||||
'ssid' => '网络名称',
|
||||
]);
|
||||
|
||||
//连接一个开放并隐藏的网络.
|
||||
QrCode::wiFi([
|
||||
'ssid' => '网络名称',
|
||||
'hidden' => 'true'
|
||||
]);
|
||||
|
||||
//连接一个加密的WIFI网络.
|
||||
QrCode::wiFi([
|
||||
'ssid' => '网络名称',
|
||||
'encryption' => 'WPA',
|
||||
'password' => '密码'
|
||||
]);
|
||||
|
||||
> WIFI扫描目前不支持在苹果产品。
|
||||
|
||||
<a id="docs-common-usage"></a>
|
||||
##QrCode 常规用法
|
||||
|
||||
你还能通过下面表中的前缀信息创建适合更多场合的二维码
|
||||
|
||||
QrCode::generate('http://www.simplesoftware.io');
|
||||
|
||||
|
||||
| 使用场景 | 前缀 | 例子 |
|
||||
| --- | --- | --- |
|
||||
| 网址 | http:// | http://www.simplesoftware.io |
|
||||
| 加密网址 | https:// | https://www.simplesoftware.io |
|
||||
| E-mail 地址 | mailto: | mailto:support@simplesoftware.io |
|
||||
| 电话号码 | tel: | tel:555-555-5555 |
|
||||
| 文字短信 | sms: | sms:555-555-5555 |
|
||||
| 文字短信内容 | sms: | sms::I am a pretyped message |
|
||||
| 文字短信同时附带手机号和短信内容 | sms: | sms:555-555-5555:I am a pretyped message |
|
||||
| 坐标 | geo: | geo:-78.400364,-85.916993 |
|
||||
| MeCard名片 | mecard: | MECARD:Simple, Software;Some Address, Somewhere, 20430;TEL:555-555-5555;EMAIL:support@simplesoftware.io; |
|
||||
| VCard名片 | BEGIN:VCARD | [See Examples](https://en.wikipedia.org/wiki/VCard) |
|
||||
| Wifi | wifi: | wifi:WEP/WPA;SSID;PSK;Hidden(True/False) |
|
||||
|
||||
<a id="docs-outside-laravel"></a>
|
||||
##在Laravel外的调用方式
|
||||
|
||||
你还可以在Laravel框架之外调用,只需要实例化 `BaconQrCodeGenerator` 类.
|
||||
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
$qrcode = new BaconQrCodeGenerator;
|
||||
$qrcode->size(500)->generate('Make a qrcode without Laravel!');
|
||||
18
vendor/simplesoftwareio/simple-qrcode/phpunit.xml
vendored
Normal file
18
vendor/simplesoftwareio/simple-qrcode/phpunit.xml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="./vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Application Test Suite">
|
||||
<directory>./tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
290
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/BaconQrCodeGenerator.php
vendored
Normal file
290
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/BaconQrCodeGenerator.php
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
use BaconQrCode;
|
||||
use BaconQrCode\Common\ErrorCorrectionLevel;
|
||||
use BaconQrCode\Encoder\Encoder;
|
||||
use BaconQrCode\Renderer\Color\Rgb;
|
||||
use BaconQrCode\Renderer\Image\Eps;
|
||||
use BaconQrCode\Renderer\Image\Png;
|
||||
use BaconQrCode\Renderer\Image\RendererInterface;
|
||||
use BaconQrCode\Renderer\Image\Svg;
|
||||
use BaconQrCode\Writer;
|
||||
|
||||
class BaconQrCodeGenerator implements QrCodeInterface
|
||||
{
|
||||
/**
|
||||
* Holds the BaconQrCode Writer Object.
|
||||
*
|
||||
* @var \BaconQrCode\Writer
|
||||
*/
|
||||
protected $writer;
|
||||
|
||||
/**
|
||||
* Holds the QrCode error correction levels. This is stored by using the BaconQrCode ErrorCorrectionLevel class constants.
|
||||
*
|
||||
* @var \BaconQrCode\Common\ErrorCorrectionLevel
|
||||
*/
|
||||
protected $errorCorrection = ErrorCorrectionLevel::L;
|
||||
|
||||
/**
|
||||
* Holds the Encoder mode to encode a QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING;
|
||||
|
||||
/**
|
||||
* Holds an image string that will be merged with the QrCode.
|
||||
*
|
||||
* @var null|string
|
||||
*/
|
||||
protected $imageMerge = null;
|
||||
|
||||
/**
|
||||
* The percentage that a merged image should take over the source image.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $imagePercentage = .2;
|
||||
|
||||
/**
|
||||
* BaconQrCodeGenerator constructor.
|
||||
*
|
||||
* @param Writer|null $writer
|
||||
* @param RendererInterface|null $format
|
||||
*/
|
||||
public function __construct(Writer $writer = null, RendererInterface $format = null)
|
||||
{
|
||||
$format = $format ?: new Svg();
|
||||
$this->writer = $writer ?: new Writer($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a QrCode.
|
||||
*
|
||||
* @param string $text The text to be converted into a QrCode
|
||||
* @param null|string $filename The filename and path to save the QrCode file
|
||||
*
|
||||
* @return string|void Returns a QrCode string depending on the format, or saves to a file.
|
||||
*/
|
||||
public function generate($text, $filename = null)
|
||||
{
|
||||
$qrCode = $this->writer->writeString($text, $this->encoding, $this->errorCorrection);
|
||||
|
||||
if ($this->imageMerge !== null) {
|
||||
$merger = new ImageMerge(new Image($qrCode), new Image($this->imageMerge));
|
||||
$qrCode = $merger->merge($this->imagePercentage);
|
||||
}
|
||||
|
||||
if ($filename === null) {
|
||||
return $qrCode;
|
||||
}
|
||||
|
||||
return file_put_contents($filename, $qrCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges an image with the center of the QrCode.
|
||||
*
|
||||
* @param $filepath string The filepath to an image
|
||||
* @param $percentage float The amount that the merged image should be placed over the qrcode.
|
||||
* @param $absolute boolean Whether to use an absolute filepath or not.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function merge($filepath, $percentage = .2, $absolute = false)
|
||||
{
|
||||
if (function_exists('base_path') && !$absolute) {
|
||||
$filepath = base_path().$filepath;
|
||||
}
|
||||
|
||||
$this->imageMerge = file_get_contents($filepath);
|
||||
$this->imagePercentage = $percentage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges an image string with the center of the QrCode, does not check for correct format.
|
||||
*
|
||||
* @param $content string The string contents of an image.
|
||||
* @param $percentage float The amount that the merged image should be placed over the qrcode.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function mergeString($content, $percentage = .2)
|
||||
{
|
||||
$this->imageMerge = $content;
|
||||
$this->imagePercentage = $percentage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the format of the outputted QrCode or defaults to SVG.
|
||||
*
|
||||
* @param string $format The desired format.
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function format($format)
|
||||
{
|
||||
switch ($format) {
|
||||
case 'png':
|
||||
$this->writer->setRenderer(new Png());
|
||||
break;
|
||||
case 'eps':
|
||||
$this->writer->setRenderer(new Eps());
|
||||
break;
|
||||
case 'svg':
|
||||
$this->writer->setRenderer(new Svg());
|
||||
break;
|
||||
default:
|
||||
throw new \InvalidArgumentException('Invalid format provided.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the size of the QrCode.
|
||||
*
|
||||
* @param int $pixels The size of the QrCode in pixels
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function size($pixels)
|
||||
{
|
||||
$this->writer->getRenderer()->setHeight($pixels);
|
||||
$this->writer->getRenderer()->setWidth($pixels);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the foreground color of a QrCode.
|
||||
*
|
||||
* @param int $red
|
||||
* @param int $green
|
||||
* @param int $blue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function color($red, $green, $blue)
|
||||
{
|
||||
$this->writer->getRenderer()->setForegroundColor(new Rgb($red, $green, $blue));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the background color of a QrCode.
|
||||
*
|
||||
* @param int $red
|
||||
* @param int $green
|
||||
* @param int $blue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function backgroundColor($red, $green, $blue)
|
||||
{
|
||||
$this->writer->getRenderer()->setBackgroundColor(new Rgb($red, $green, $blue));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the error correction level of a QrCode.
|
||||
*
|
||||
* @param string $level Desired error correction level. L = 7% M = 15% Q = 25% H = 30%
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function errorCorrection($level)
|
||||
{
|
||||
$this->errorCorrection = constant("BaconQrCode\Common\ErrorCorrectionLevel::$level");
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a margin around the QrCode.
|
||||
*
|
||||
* @param int $margin The desired margin in pixels around the QrCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function margin($margin)
|
||||
{
|
||||
$this->writer->getRenderer()->setMargin($margin);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Encoding mode.
|
||||
*
|
||||
* @param string $encoding
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function encoding($encoding)
|
||||
{
|
||||
$this->encoding = $encoding;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new datatype object and then generates a QrCode.
|
||||
*
|
||||
* @param $method
|
||||
* @param $arguments
|
||||
*/
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
$dataType = $this->createClass($method);
|
||||
|
||||
$dataType->create($arguments);
|
||||
|
||||
return $this->generate(strval($dataType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DataType class dynamically.
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @return SimpleSoftwareIO\QrCode\DataTypes\DataTypeInterface
|
||||
*/
|
||||
private function createClass($method)
|
||||
{
|
||||
$class = $this->formatClass($method);
|
||||
|
||||
if (!class_exists($class)) {
|
||||
throw new \BadMethodCallException();
|
||||
}
|
||||
|
||||
return new $class();
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the method name correctly.
|
||||
*
|
||||
* @param $method
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function formatClass($method)
|
||||
{
|
||||
$method = ucfirst($method);
|
||||
|
||||
$class = "SimpleSoftwareIO\QrCode\DataTypes\\".$method;
|
||||
|
||||
return $class;
|
||||
}
|
||||
}
|
||||
134
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/BTC.php
vendored
Normal file
134
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/BTC.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
class BTC implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'bitcoin:';
|
||||
|
||||
/**
|
||||
* The separator between the variables.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $separator = '&';
|
||||
|
||||
/**
|
||||
* The BitCoin address.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $address;
|
||||
|
||||
/**
|
||||
* The amount to send.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $amount;
|
||||
|
||||
/**
|
||||
* The BitCoin transaction label.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $label;
|
||||
|
||||
/**
|
||||
* The BitCoin message to send.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* The BitCoin return URL.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $returnAddress;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->setProperties($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->buildBitCoinString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the BitCoin arguments.
|
||||
*
|
||||
* @param array $arguments
|
||||
*/
|
||||
protected function setProperties(array $arguments)
|
||||
{
|
||||
if (isset($arguments[0])) {
|
||||
$this->address = $arguments[0];
|
||||
}
|
||||
|
||||
if (isset($arguments[1])) {
|
||||
$this->amount = $arguments[1];
|
||||
}
|
||||
|
||||
if (isset($arguments[2])) {
|
||||
$this->setOptions($arguments[2]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the optional BitCoin options.
|
||||
*
|
||||
* @param array $options
|
||||
*/
|
||||
protected function setOptions(array $options)
|
||||
{
|
||||
if (isset($options['label'])) {
|
||||
$this->label = $options['label'];
|
||||
}
|
||||
|
||||
if (isset($options['message'])) {
|
||||
$this->message = $options['message'];
|
||||
}
|
||||
|
||||
if (isset($options['returnAddress'])) {
|
||||
$this->returnAddress = $options['returnAddress'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a BitCoin string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildBitCoinString()
|
||||
{
|
||||
$query = http_build_query([
|
||||
'amount' => $this->amount,
|
||||
'label' => $this->label,
|
||||
'$message' => $this->message,
|
||||
'r' => $this->returnAddress,
|
||||
]);
|
||||
|
||||
$btc = $this->prefix.$this->address.'?'.$query;
|
||||
|
||||
return $btc;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
interface DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*/
|
||||
public function create(array $arguments);
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString();
|
||||
}
|
||||
122
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/Email.php
vendored
Normal file
122
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/Email.php
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
use BaconQrCode\Exception\InvalidArgumentException;
|
||||
|
||||
class Email implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'mailto:';
|
||||
|
||||
/**
|
||||
* The email address.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $email;
|
||||
|
||||
/**
|
||||
* The subject of the email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $subject;
|
||||
|
||||
/**
|
||||
* The body of an email.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $body;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->setProperties($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->buildEmailString();
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds the email string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildEmailString()
|
||||
{
|
||||
$email = $this->prefix.$this->email;
|
||||
|
||||
if (isset($this->subject) || isset($this->body)) {
|
||||
$data = [
|
||||
'subject' => $this->subject,
|
||||
'body' => $this->body,
|
||||
];
|
||||
$email .= '?'.http_build_query($data);
|
||||
}
|
||||
|
||||
return $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the objects properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
protected function setProperties(array $arguments)
|
||||
{
|
||||
if (isset($arguments[0])) {
|
||||
$this->setEmail($arguments[0]);
|
||||
}
|
||||
if (isset($arguments[1])) {
|
||||
$this->subject = $arguments[1];
|
||||
}
|
||||
if (isset($arguments[2])) {
|
||||
$this->body = $arguments[2];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email property.
|
||||
*
|
||||
* @param $email
|
||||
*/
|
||||
protected function setEmail($email)
|
||||
{
|
||||
if ($this->isValidEmail($email)) {
|
||||
$this->email = $email;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures an email is valid.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function isValidEmail($email)
|
||||
{
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
throw new InvalidArgumentException('Invalid email provided');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
55
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/Geo.php
vendored
Normal file
55
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/Geo.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
class Geo implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'geo:';
|
||||
|
||||
/**
|
||||
* The separator between the variables.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $separator = ',';
|
||||
|
||||
/**
|
||||
* The latitude.
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
protected $latitude;
|
||||
|
||||
/**
|
||||
* The longitude.
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
protected $longitude;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->latitude = $arguments[0];
|
||||
$this->longitude = $arguments[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->prefix.$this->latitude.$this->separator.$this->longitude;
|
||||
}
|
||||
}
|
||||
40
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/PhoneNumber.php
vendored
Normal file
40
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/PhoneNumber.php
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
class PhoneNumber implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'tel:';
|
||||
|
||||
/**
|
||||
* The phone number.
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
protected $phoneNumber;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->phoneNumber = $arguments[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->prefix.$this->phoneNumber;
|
||||
}
|
||||
}
|
||||
85
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/SMS.php
vendored
Normal file
85
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/SMS.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
class SMS implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'sms:';
|
||||
|
||||
/**
|
||||
* The separator between the variables.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $separator = ':';
|
||||
|
||||
/**
|
||||
* The phone number.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $phoneNumber;
|
||||
|
||||
/**
|
||||
* The SMS message.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->setProperties($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->buildSMSString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the phone number and message for a sms message.
|
||||
*
|
||||
* @param array $arguments
|
||||
*/
|
||||
protected function setProperties(array $arguments)
|
||||
{
|
||||
if (isset($arguments[0])) {
|
||||
$this->phoneNumber = $arguments[0];
|
||||
}
|
||||
if (isset($arguments[1])) {
|
||||
$this->message = $arguments[1];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a SMS string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildSMSString()
|
||||
{
|
||||
$sms = $this->prefix.$this->phoneNumber;
|
||||
|
||||
if (isset($this->message)) {
|
||||
$sms .= $this->separator.$this->message;
|
||||
}
|
||||
|
||||
return $sms;
|
||||
}
|
||||
}
|
||||
115
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/WiFi.php
vendored
Normal file
115
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/DataTypes/WiFi.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\DataTypes;
|
||||
|
||||
class WiFi implements DataTypeInterface
|
||||
{
|
||||
/**
|
||||
* The prefix of the QrCode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = 'WIFI:';
|
||||
|
||||
/**
|
||||
* The separator between the variables.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $separator = ';';
|
||||
|
||||
/**
|
||||
* The encryption of the network. WEP or WPA.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $encryption;
|
||||
|
||||
/**
|
||||
* The SSID of the WiFi network.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $ssid;
|
||||
|
||||
/**
|
||||
* The password of the network.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Whether the network is a hidden SSID or not.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $hidden;
|
||||
|
||||
/**
|
||||
* Generates the DataType Object and sets all of its properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
public function create(array $arguments)
|
||||
{
|
||||
$this->setProperties($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the correct QrCode format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->buildWifiString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the WiFi string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildWifiString()
|
||||
{
|
||||
$wifi = $this->prefix;
|
||||
|
||||
if (isset($this->encryption)) {
|
||||
$wifi .= 'T:'.$this->encryption.$this->separator;
|
||||
}
|
||||
if (isset($this->ssid)) {
|
||||
$wifi .= 'S:'.$this->ssid.$this->separator;
|
||||
}
|
||||
if (isset($this->password)) {
|
||||
$wifi .= 'P:'.$this->password.$this->separator;
|
||||
}
|
||||
if (isset($this->hidden)) {
|
||||
$wifi .= 'H:'.$this->hidden.$this->separator;
|
||||
}
|
||||
|
||||
return $wifi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the WiFi properties.
|
||||
*
|
||||
* @param $arguments
|
||||
*/
|
||||
protected function setProperties(array $arguments)
|
||||
{
|
||||
$arguments = $arguments[0];
|
||||
if (isset($arguments['encryption'])) {
|
||||
$this->encryption = $arguments['encryption'];
|
||||
}
|
||||
if (isset($arguments['ssid'])) {
|
||||
$this->ssid = $arguments['ssid'];
|
||||
}
|
||||
if (isset($arguments['password'])) {
|
||||
$this->password = $arguments['password'];
|
||||
}
|
||||
if (isset($arguments['hidden'])) {
|
||||
$this->hidden = $arguments['hidden'];
|
||||
}
|
||||
}
|
||||
}
|
||||
20
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/Facades/QrCode.php
vendored
Normal file
20
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/Facades/QrCode.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class QrCode extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
self::clearResolvedInstance('qrcode');
|
||||
|
||||
return 'qrcode';
|
||||
}
|
||||
}
|
||||
53
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/Image.php
vendored
Normal file
53
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/Image.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
class Image implements ImageInterface
|
||||
{
|
||||
/**
|
||||
* Holds the image resource.
|
||||
*
|
||||
* @var resource
|
||||
*/
|
||||
protected $image;
|
||||
|
||||
/**
|
||||
* Creates a new Image object.
|
||||
*
|
||||
* @param $image string An image string
|
||||
*/
|
||||
public function __construct($image)
|
||||
{
|
||||
$this->image = imagecreatefromstring($image);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the width of an image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return imagesx($this->image);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the height of an image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return imagesy($this->image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the image string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageResource()
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
}
|
||||
34
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageInterface.php
vendored
Normal file
34
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageInterface.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
interface ImageInterface
|
||||
{
|
||||
/**
|
||||
* Creates a new Image object.
|
||||
*
|
||||
* @param $image string An image string
|
||||
*/
|
||||
public function __construct($image);
|
||||
|
||||
/*
|
||||
* Returns the width of an image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getWidth();
|
||||
|
||||
/*
|
||||
* Returns the height of an image
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getHeight();
|
||||
|
||||
/**
|
||||
* Returns the image string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageResource();
|
||||
}
|
||||
170
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageMerge.php
vendored
Normal file
170
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageMerge.php
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
class ImageMerge implements ImageMergeInterface
|
||||
{
|
||||
/**
|
||||
* Holds the QrCode image.
|
||||
*
|
||||
* @var Image
|
||||
*/
|
||||
protected $sourceImage;
|
||||
|
||||
/**
|
||||
* Holds the merging image.
|
||||
*
|
||||
* @var Image
|
||||
*/
|
||||
protected $mergeImage;
|
||||
|
||||
/**
|
||||
* The height of the source image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $sourceImageHeight;
|
||||
|
||||
/**
|
||||
* The width of the source image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $sourceImageWidth;
|
||||
|
||||
/**
|
||||
* The height of the merge image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $mergeImageHeight;
|
||||
|
||||
/**
|
||||
* The width of the merge image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $mergeImageWidth;
|
||||
|
||||
/**
|
||||
* The height of the merge image after it is merged.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $postMergeImageHeight;
|
||||
|
||||
/**
|
||||
* The width of the merge image after it is merged.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $postMergeImageWidth;
|
||||
|
||||
/**
|
||||
* The position that the merge image is placed on top of the source image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $centerY;
|
||||
|
||||
/**
|
||||
* The position that the merge image is placed on top of the source image.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $centerX;
|
||||
|
||||
/**
|
||||
* Creates a new ImageMerge object.
|
||||
*
|
||||
* @param $sourceImage Image The image that will be merged over.
|
||||
* @param $mergeImage Image The image that will be used to merge with $sourceImage
|
||||
*/
|
||||
public function __construct(Image $sourceImage, Image $mergeImage)
|
||||
{
|
||||
$this->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);
|
||||
|
||||
imagecopyresampled(
|
||||
$this->sourceImage->getImageResource(),
|
||||
$this->mergeImage->getImageResource(),
|
||||
$this->centerX,
|
||||
$this->centerY,
|
||||
0,
|
||||
0,
|
||||
$this->postMergeImageWidth,
|
||||
$this->postMergeImageHeight,
|
||||
$this->mergeImageWidth,
|
||||
$this->mergeImageHeight
|
||||
);
|
||||
|
||||
return $this->createImage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PNG Image.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function createImage()
|
||||
{
|
||||
ob_start();
|
||||
imagepng($this->sourceImage->getImageResource());
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the objects properties.
|
||||
*
|
||||
* @param $percentage float The percentage that the merge image should take up.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
private function calculateCenter()
|
||||
{
|
||||
$this->centerY = ($this->sourceImageHeight / 2) - ($this->postMergeImageHeight / 2);
|
||||
$this->centerX = ($this->sourceImageWidth / 2) - ($this->postMergeImageHeight / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the width of the merge image being placed on the source image.
|
||||
*
|
||||
* @param float $percentage
|
||||
*/
|
||||
private function calculateOverlap($percentage)
|
||||
{
|
||||
$this->postMergeImageHeight = $this->sourceImageHeight * $percentage;
|
||||
$this->postMergeImageWidth = $this->sourceImageWidth * $percentage;
|
||||
}
|
||||
}
|
||||
21
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageMergeInterface.php
vendored
Normal file
21
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/ImageMergeInterface.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
interface ImageMergeInterface
|
||||
{
|
||||
/**
|
||||
* Creates a new ImageMerge object.
|
||||
*
|
||||
* @param $sourceImage Image The image that will be merged over.
|
||||
* @param $mergeImage Image The image that will be used to merge with $sourceImage
|
||||
*/
|
||||
public function __construct(Image $sourceImage, Image $mergeImage);
|
||||
|
||||
/*
|
||||
* Returns an QrCode that has been merge with another image. This is usually used with logos to imprint a logo into a QrCode.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function merge($percentage);
|
||||
}
|
||||
93
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/QrCodeInterface.php
vendored
Normal file
93
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/QrCodeInterface.php
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
interface QrCodeInterface
|
||||
{
|
||||
/**
|
||||
* Generates a QrCode.
|
||||
*
|
||||
* @param string $text The text to be converted into a QrCode
|
||||
* @param null|string $filename The filename and path to save the QrCode file
|
||||
*
|
||||
* @return string|void Returns a QrCode string depending on the format, or saves to a file.
|
||||
*/
|
||||
public function generate($text, $filename = null);
|
||||
|
||||
/**
|
||||
* Switches the format of the outputted QrCode or defaults to SVG.
|
||||
*
|
||||
* @param string $format
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function format($format);
|
||||
|
||||
/**
|
||||
* Changes the size of the QrCode.
|
||||
*
|
||||
* @param int $pixels The size of the QrCode in pixels
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function size($pixels);
|
||||
|
||||
/**
|
||||
* Changes the foreground color of a QrCode.
|
||||
*
|
||||
* @param int $red
|
||||
* @param int $green
|
||||
* @param int $blue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function color($red, $green, $blue);
|
||||
|
||||
/**
|
||||
* Changes the background color of a QrCode.
|
||||
*
|
||||
* @param int $red
|
||||
* @param int $green
|
||||
* @param int $blue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function backgroundColor($red, $green, $blue);
|
||||
|
||||
/**
|
||||
* Changes the error correction level of a QrCode.
|
||||
*
|
||||
* @param string $level Desired error correction level. L = 7% M = 15% Q = 25% H = 30%
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function errorCorrection($level);
|
||||
|
||||
/**
|
||||
* Creates a margin around the QrCode.
|
||||
*
|
||||
* @param int $margin The desired margin in pixels around the QrCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function margin($margin);
|
||||
|
||||
/**
|
||||
* Sets the Encoding mode.
|
||||
*
|
||||
* @param string $encoding
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function encoding($encoding);
|
||||
|
||||
/**
|
||||
* Merges an image with the center of the QrCode.
|
||||
*
|
||||
* @param $image string The filepath to an image
|
||||
* @param $percentage float The percentage that the merge image should take up.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function merge($image, $percentage = .2);
|
||||
}
|
||||
35
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/QrCodeServiceProvider.php
vendored
Normal file
35
vendor/simplesoftwareio/simple-qrcode/src/SimpleSoftwareIO/QrCode/QrCodeServiceProvider.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleSoftwareIO\QrCode;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class QrCodeServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $defer = true;
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind('qrcode', function () {
|
||||
return new BaconQrCodeGenerator();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return ['qrcode'];
|
||||
}
|
||||
}
|
||||
137
vendor/simplesoftwareio/simple-qrcode/tests/BaconQrCodeGeneratorTest.php
vendored
Normal file
137
vendor/simplesoftwareio/simple-qrcode/tests/BaconQrCodeGeneratorTest.php
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
use Mockery as m;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\BaconQrCodeGenerator;
|
||||
|
||||
class BaconQrCodeGeneratorTest extends TestCase
|
||||
{
|
||||
public function tearDown()
|
||||
{
|
||||
if ($container = m::getContainer()) {
|
||||
$this->addToAssertionCount($container->mockery_getExpectationCount());
|
||||
}
|
||||
|
||||
m::close();
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->writer = m::mock('\BaconQrCode\Writer');
|
||||
$this->format = m::mock('\BaconQrCode\Renderer\Image\RendererInterface');
|
||||
$this->qrCode = new BaconQrCodeGenerator($this->writer, $this->format);
|
||||
}
|
||||
|
||||
public function test_it_sets_the_margin()
|
||||
{
|
||||
$this->format->shouldReceive('setMargin')
|
||||
->with('50')
|
||||
->once();
|
||||
|
||||
$this->writer->shouldReceive('getRenderer')
|
||||
->once()
|
||||
->andReturn($this->format);
|
||||
|
||||
$this->qrCode->margin(50);
|
||||
}
|
||||
|
||||
public function test_it_sets_the_background_color()
|
||||
{
|
||||
$this->format->shouldReceive('setBackgroundColor')
|
||||
->once();
|
||||
|
||||
$this->writer->shouldReceive('getRenderer')
|
||||
->once()
|
||||
->andReturn($this->format);
|
||||
|
||||
$this->qrCode->backgroundColor(255, 255, 255);
|
||||
}
|
||||
|
||||
public function test_it_sets_the_foreground_color()
|
||||
{
|
||||
$this->format->shouldReceive('setForegroundColor')
|
||||
->once();
|
||||
|
||||
$this->writer->shouldReceive('getRenderer')
|
||||
->once()
|
||||
->andReturn($this->format);
|
||||
|
||||
$this->qrCode->color(255, 255, 255);
|
||||
}
|
||||
|
||||
public function test_it_sets_the_size()
|
||||
{
|
||||
$this->format->shouldReceive('setHeight')
|
||||
->with(50)
|
||||
->once();
|
||||
$this->format->shouldReceive('setWidth')
|
||||
->with(50)
|
||||
->once();
|
||||
|
||||
$this->writer->shouldReceive('getRenderer')
|
||||
->twice()
|
||||
->andReturn($this->format);
|
||||
|
||||
$this->qrCode->size(50);
|
||||
}
|
||||
|
||||
public function test_it_sets_a_png_format()
|
||||
{
|
||||
$this->writer->shouldReceive('setRenderer')
|
||||
->with('BaconQrCode\Renderer\Image\Png')
|
||||
->once();
|
||||
|
||||
$this->qrCode->format('png');
|
||||
}
|
||||
|
||||
public function test_it_sets_a_eps_format()
|
||||
{
|
||||
$this->writer->shouldReceive('setRenderer')
|
||||
->with('BaconQrCode\Renderer\Image\Eps')
|
||||
->once();
|
||||
|
||||
$this->qrCode->format('eps');
|
||||
}
|
||||
|
||||
public function test_it_sets_a_svg_format()
|
||||
{
|
||||
$this->writer->shouldReceive('setRenderer')
|
||||
->with('BaconQrCode\Renderer\Image\Svg')
|
||||
->once();
|
||||
|
||||
$this->qrCode->format('svg');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function test_it_throws_an_exception_with_an_invalid_format()
|
||||
{
|
||||
$this->qrCode->format('random');
|
||||
}
|
||||
|
||||
public function test_it_generates_a_string()
|
||||
{
|
||||
$this->writer->shouldReceive('writeString')
|
||||
->with('qrCode', m::type('string'), m::type('int'))
|
||||
->once();
|
||||
|
||||
$this->qrCode->generate('qrCode');
|
||||
}
|
||||
|
||||
public function test_it_calls_a_valid_dynamic_method_and_generates_a_qrcode()
|
||||
{
|
||||
$this->writer->shouldReceive('writeString')
|
||||
->once();
|
||||
|
||||
$this->qrCode->phoneNumber('555-555-5555');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function test_it_throws_an_exception_if_datatype_is_not_found()
|
||||
{
|
||||
$this->qrCode->notReal('foo');
|
||||
}
|
||||
}
|
||||
47
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/BTCTest.php
vendored
Normal file
47
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/BTCTest.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\BTC;
|
||||
|
||||
class BTCTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->btc = new BTC();
|
||||
}
|
||||
|
||||
public function test_it_generates_a_valid_btc_qrcode_with_an_address_and_amount()
|
||||
{
|
||||
$this->btc->create(['btcaddress', 0.0034]);
|
||||
|
||||
$properFormat = 'bitcoin:btcaddress?amount=0.0034';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->btc));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_valid_btc_qrcode_with_an_address_amount_and_label()
|
||||
{
|
||||
$this->btc->create(['btcaddress', 0.0034, ['label' => 'label']]);
|
||||
|
||||
$properFormat = 'bitcoin:btcaddress?amount=0.0034&label=label';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->btc));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_valid_btc_qrcode_with_an_address_amount_label_message_and_return_address()
|
||||
{
|
||||
$this->btc->create([
|
||||
'btcaddress',
|
||||
0.0034,
|
||||
[
|
||||
'label' => 'label',
|
||||
'message' => 'message',
|
||||
'returnAddress' => 'https://www.returnaddress.com',
|
||||
],
|
||||
]);
|
||||
|
||||
$properFormat = 'bitcoin:btcaddress?amount=0.0034&label=label&%24message=message&r='.urlencode('https://www.returnaddress.com');
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->btc));
|
||||
}
|
||||
}
|
||||
56
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/EmailTest.php
vendored
Normal file
56
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/EmailTest.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\Email;
|
||||
|
||||
class EmailTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->email = new Email();
|
||||
}
|
||||
|
||||
public function test_it_generates_the_proper_format_when_only_an_email_address_is_supplied()
|
||||
{
|
||||
$this->email->create(['foo@bar.com']);
|
||||
|
||||
$properFormat = 'mailto:foo@bar.com';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->email));
|
||||
}
|
||||
|
||||
public function test_it_generates_the_proper_format_when_an_email_subject_and_body_are_supplied()
|
||||
{
|
||||
$this->email->create(['foo@bar.com', 'foo', 'bar']);
|
||||
|
||||
$properFormat = 'mailto:foo@bar.com?subject=foo&body=bar';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->email));
|
||||
}
|
||||
|
||||
public function test_it_generates_the_proper_format_when_an_email_and_subject_are_supplied()
|
||||
{
|
||||
$this->email->create(['foo@bar.com', 'foo']);
|
||||
|
||||
$properFormat = 'mailto:foo@bar.com?subject=foo';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->email));
|
||||
}
|
||||
|
||||
public function test_it_generates_the_proper_format_when_only_a_subject_is_provided()
|
||||
{
|
||||
$this->email->create([null, 'foo']);
|
||||
|
||||
$properFormat = 'mailto:?subject=foo';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->email));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function test_it_throws_an_exception_when_an_invalid_email_is_given()
|
||||
{
|
||||
$this->email->create(['foo']);
|
||||
}
|
||||
}
|
||||
17
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/GeoTest.php
vendored
Normal file
17
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/GeoTest.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\Geo;
|
||||
|
||||
class GeoTest extends TestCase
|
||||
{
|
||||
public function test_it_generates_the_proper_format_for_a_geo_coordinate()
|
||||
{
|
||||
$geo = new Geo();
|
||||
$geo->create([10.254, -30.254]);
|
||||
|
||||
$properFormat = 'geo:10.254,-30.254';
|
||||
|
||||
$this->assertEquals($properFormat, strval($geo));
|
||||
}
|
||||
}
|
||||
17
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/PhoneNumberTest.php
vendored
Normal file
17
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/PhoneNumberTest.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\PhoneNumber;
|
||||
|
||||
class PhoneNumberTest extends TestCase
|
||||
{
|
||||
public function test_it_generates_the_proper_format_for_calling_a_phone_number()
|
||||
{
|
||||
$phoneNumber = new PhoneNumber();
|
||||
$phoneNumber->create(['555-555-5555']);
|
||||
|
||||
$properFormat = 'tel:555-555-5555';
|
||||
|
||||
$this->assertEquals($properFormat, strval($phoneNumber));
|
||||
}
|
||||
}
|
||||
39
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/SMSTest.php
vendored
Normal file
39
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/SMSTest.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\SMS;
|
||||
|
||||
class SMSTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->sms = new SMS();
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_with_a_phone_number()
|
||||
{
|
||||
$this->sms->create(['555-555-5555']);
|
||||
|
||||
$properFormat = 'sms:555-555-5555';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->sms));
|
||||
}
|
||||
|
||||
public function test_it_generate_a_proper_format_with_a_message()
|
||||
{
|
||||
$this->sms->create([null, 'foo']);
|
||||
|
||||
$properFormat = 'sms::foo';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->sms));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_with_a_phone_number_and_message()
|
||||
{
|
||||
$this->sms->create(['555-555-5555', 'foo']);
|
||||
|
||||
$properFormat = 'sms:555-555-5555:foo';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->sms));
|
||||
}
|
||||
}
|
||||
70
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/WiFiTest.php
vendored
Normal file
70
vendor/simplesoftwareio/simple-qrcode/tests/DataTypes/WiFiTest.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\DataTypes\WiFi;
|
||||
|
||||
class WiFiTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->wifi = new Wifi();
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_with_just_the_ssid()
|
||||
{
|
||||
$this->wifi->create([
|
||||
0 => [
|
||||
'ssid' => 'foo',
|
||||
],
|
||||
]);
|
||||
|
||||
$properFormat = 'WIFI:S:foo;';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->wifi));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_for_a_ssid_that_is_hidden()
|
||||
{
|
||||
$this->wifi->create([
|
||||
0 => [
|
||||
'ssid' => 'foo',
|
||||
'hidden' => 'true',
|
||||
],
|
||||
]);
|
||||
|
||||
$properFormat = 'WIFI:S:foo;H:true;';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->wifi));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_for_a_ssid_encryption_and_password()
|
||||
{
|
||||
$this->wifi->create([
|
||||
0 => [
|
||||
'ssid' => 'foo',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'bar',
|
||||
],
|
||||
]);
|
||||
|
||||
$properFormat = 'WIFI:T:WPA;S:foo;P:bar;';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->wifi));
|
||||
}
|
||||
|
||||
public function test_it_generates_a_proper_format_for_a_ssid_encryption_password_and_is_hidden()
|
||||
{
|
||||
$this->wifi->create([
|
||||
0 => [
|
||||
'ssid' => 'foo',
|
||||
'encryption' => 'WPA',
|
||||
'password' => 'bar',
|
||||
'hidden' => 'true',
|
||||
],
|
||||
]);
|
||||
|
||||
$properFormat = 'WIFI:T:WPA;S:foo;P:bar;H:true;';
|
||||
|
||||
$this->assertEquals($properFormat, strval($this->wifi));
|
||||
}
|
||||
}
|
||||
89
vendor/simplesoftwareio/simple-qrcode/tests/ImageMergeTest.php
vendored
Normal file
89
vendor/simplesoftwareio/simple-qrcode/tests/ImageMergeTest.php
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\Image;
|
||||
use SimpleSoftwareIO\QrCode\ImageMerge;
|
||||
|
||||
class ImageMergeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* The location to save the testing image.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $testImageSaveLocation;
|
||||
|
||||
/**
|
||||
* The location to save the compare image.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $compareTestSaveLocation;
|
||||
|
||||
/**
|
||||
* The ImageMerge Object.
|
||||
*
|
||||
* @var ImageMerge
|
||||
*/
|
||||
protected $testImage;
|
||||
|
||||
/**
|
||||
* The location of the test image to use.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $testImagePath;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->testImagePath = file_get_contents(dirname(__FILE__).'/Images/simplesoftware-icon-grey-blue.png');
|
||||
$this->testImage = new ImageMerge(
|
||||
new Image($this->testImagePath),
|
||||
new Image($this->testImagePath)
|
||||
);
|
||||
|
||||
$this->testImageSaveLocation = dirname(__FILE__).'/testImage.png';
|
||||
$this->compareTestSaveLocation = dirname(__FILE__).'/compareImage.png';
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
@unlink($this->testImageSaveLocation);
|
||||
@unlink($this->compareTestSaveLocation);
|
||||
}
|
||||
|
||||
public function test_it_merges_two_images_together_and_centers_it()
|
||||
{
|
||||
//We know the test image is 512x512
|
||||
$source = imagecreatefromstring($this->testImagePath);
|
||||
$merge = imagecreatefromstring($this->testImagePath);
|
||||
|
||||
//Create a PNG and place the image in the middle using 20% of the area.
|
||||
imagecopyresampled(
|
||||
$source,
|
||||
$merge,
|
||||
204,
|
||||
204,
|
||||
0,
|
||||
0,
|
||||
102,
|
||||
102,
|
||||
512,
|
||||
512
|
||||
);
|
||||
imagepng($source, $this->compareTestSaveLocation);
|
||||
|
||||
$testImage = $this->testImage->merge(.2);
|
||||
file_put_contents($this->testImageSaveLocation, $testImage);
|
||||
|
||||
$this->assertEquals(file_get_contents($this->compareTestSaveLocation), file_get_contents($this->testImageSaveLocation));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
*/
|
||||
public function test_it_throws_an_exception_when_percentage_is_greater_than_1()
|
||||
{
|
||||
$this->testImage->merge(1.1);
|
||||
}
|
||||
}
|
||||
82
vendor/simplesoftwareio/simple-qrcode/tests/ImageTest.php
vendored
Normal file
82
vendor/simplesoftwareio/simple-qrcode/tests/ImageTest.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use SimpleSoftwareIO\QrCode\Image;
|
||||
|
||||
class ImageTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* The location to save the testing image.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $testImageSaveLocation;
|
||||
|
||||
/**
|
||||
* The location to save the compare image.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $compareTestSaveLocation;
|
||||
|
||||
/**
|
||||
* The path to the image used to test.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $imagePath;
|
||||
|
||||
/**
|
||||
* The Image object.
|
||||
*
|
||||
* @var Image
|
||||
*/
|
||||
protected $image;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->imagePath = file_get_contents(dirname(__FILE__).'/Images/simplesoftware-icon-grey-blue.png');
|
||||
$this->image = new Image($this->imagePath);
|
||||
|
||||
$this->testImageSaveLocation = dirname(__FILE__).'/testImage.png';
|
||||
$this->compareTestSaveLocation = dirname(__FILE__).'/compareImage.png';
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
@unlink($this->testImageSaveLocation);
|
||||
@unlink($this->compareTestSaveLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Must test that the outputted PNG is the same because you can not compare resources.
|
||||
*/
|
||||
public function test_it_loads_an_image_string_into_a_resource()
|
||||
{
|
||||
imagepng(imagecreatefromstring($this->imagePath), $this->compareTestSaveLocation);
|
||||
imagepng($this->image->getImageResource(), $this->testImageSaveLocation);
|
||||
|
||||
$correctImage = file_get_contents($this->compareTestSaveLocation);
|
||||
$testImage = file_get_contents($this->testImageSaveLocation);
|
||||
|
||||
$this->assertEquals($correctImage, $testImage);
|
||||
}
|
||||
|
||||
public function test_it_gets_the_correct_height()
|
||||
{
|
||||
$correctHeight = 512;
|
||||
|
||||
$testHeight = $this->image->getHeight();
|
||||
|
||||
$this->assertEquals($correctHeight, $testHeight);
|
||||
}
|
||||
|
||||
public function test_it_gets_the_correct_width()
|
||||
{
|
||||
$correctWidth = 512;
|
||||
|
||||
$testWidth = $this->image->getWidth();
|
||||
|
||||
$this->assertEquals($correctWidth, $testWidth);
|
||||
}
|
||||
}
|
||||
BIN
vendor/simplesoftwareio/simple-qrcode/tests/Images/simplesoftware-icon-grey-blue.png
vendored
Normal file
BIN
vendor/simplesoftwareio/simple-qrcode/tests/Images/simplesoftware-icon-grey-blue.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
3
vendor/simplesoftwareio/simple-qrcode/tests/bootstrap.php
vendored
Normal file
3
vendor/simplesoftwareio/simple-qrcode/tests/bootstrap.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
Reference in New Issue
Block a user