Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Hutschenreiter committed Apr 30, 2019
0 parents commit 529fa54
Show file tree
Hide file tree
Showing 29 changed files with 870 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_site/
.idea/
vendor/
composer.lock
Gemfile.lock
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: php
php:
- '7.1'
install: composer install
47 changes: 47 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributor Covenant Code of Conduct


## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at brunovaulawerneck@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To contribute to this project, please do the following:

- Fork it
- Create a new branch for your contribution
- Test it! Make sure it works and it won't break the master code
- Send pull request

Contributors will be added to package descriptor

Make sure you abide to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md)
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
source 'https://rubygems.org'

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

if Gem.win_platform?
gem 'github-pages', '170', group: :jekyll_plugins
else
gem 'github-pages', group: :jekyll_plugins
end
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**(MIT)**

Copyright 2018 Bruno Vaula Werneck

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.
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Laravel QR Code Generator

Create QR Codes with Laravel

This is a wrapper for [QR Code Generator for PHP](https://werneckbh.github.io/qr-code), a standalone library to generate QR Codes in PNG and SVG.

## Installation

Install using **composer**:

```bash
$ composer require werneckbh/laravel-qr-code
```
##### Laravel 5.4 (5.5+ can skip this step)

You need to add provider and alias to your `config/app.php` file:

```php
<?php

'providers' => [

LaravelQRCode\Providers\QRCodeServiceProvider::class,

],


'aliases' => [

'QRCode' => LaravelQRCode\Facades\QRCode::class,

]
```
## QR Code Types

Laravel QR Code Generator supports the following QR Codes:

- Calendar Event
- Email Message
- Phone
- SMS
- Text
- URL
- meCard
- vCard v3
- Wi-fi Network Settings

## Usage

```php
<?php

Route::get('qr-code', function ()
{
return QRCode::text('QR Code Generator for Laravel!')->png();
});

```
The above route should print a PNG image for a text QR Code.

Make sure you check the [Documentation](https://werneckbh.github.io/laravel-qr-code/) for further instructions.

## [Contributing](CONTRIBUTING.md)

To contribute to this project, please do the following:

- Fork it
- Create a new branch for your contribution
- Test it! Make sure it works and it won't break the master code
- Send pull request

Contributors will be added to package descriptor. Make sure you abide to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md)

## [License](LICENSE.md)

**(MIT)**

Copyright 2018 Bruno Vaula Werneck

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.
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "42coders/laravel-qr-code",
"description": "QR Code Generator for PHP wrapper for Laravel. Forked from Bruno Werneck",
"license": "MIT",
"authors": [
{
"name": "Bruno Werneck",
"email": "brunovaulawerneck@gmail.com"
},
{
"name": "Max Hutschenreiter",
"email": "max@42coders.com"
}
],
"minimum-stability": "dev",
"require": {
"42coders/qr-code": "^2.1"
},
"autoload": {
"psr-4": {
"LaravelQRCode\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"LaravelQRCode\\Providers\\QRCodeServiceProvider"
],
"aliases": {
"QRCode": "LaravelQRCode\\Facades\\QRCode"
}
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
theme: jekyll-theme-cayman
repository: werneckbh/laravel-qr-code
title: Laravel QR Code Generator
description: A QR Code Generator for PHP wrapper for Laravel
show_downloads: true
48 changes: 48 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset="UTF-8">

{% seo %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
</head>
<body>
<section class="page-header">
<h1 class="project-name">{{ site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ site.description | default: site.github.project_tagline }}</h2>
{% if site.github.is_project_page %}
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
{% endif %}
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
{% endif %}
</section>

<section class="main-content">
{{ content }}

<footer class="site-footer">
{% if site.github.is_project_page %}
<span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
{% endif %}
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</section>

{% if site.google_analytics %}
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>
24 changes: 24 additions & 0 deletions docs/calendar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
> [Laravel QR Code Generator](index.md) >> [QR Code Types](index.md#code-types) >> Calendar Event
---
# Calendar Event

```php
<?php

Route::get('qr-code/examples/calendar', function ()
{
// Required params
$start = new \DateTime('next saturday 7pm');
$end = new \DateTime('next saturday 11pm');
$summary = 'Interview with Neil DeGrasse Tyson';

// Optional params
$description = 'Meet Mr. Tyson at Per Se and interview him about the asteroid Apophis';
$location = 'Time Warner Center, 10 Columbus Cir, New York, NY 10023, USA';

return QRCode::calendar($start, $end, $summary, $description, $location)->svg();
});
```


19 changes: 19 additions & 0 deletions docs/email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
> [Laravel QR Code Generator](index.md) >> [QR Code Types](index.md#code-types) >> Email Message
---
# Email Message

```php
<?php

Route::get('qr-code/examples/email', function ()
{

$to = 'john.doe@example.com';
$subject = 'QR Code Message';
$body = 'This email was created from a QR Code!';

return QRCode::email($to, $body, $subject)->png();

});
```
65 changes: 65 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Laravel QR Code Generator

Create QR Codes with Laravel

This is a wrapper for [QR Code Generator for PHP](https://werneckbh.github.io/qr-code), a standalone library to generate QR Codes in PNG and SVG.

## Installation

Install using **composer**:

```bash
$ composer require werneckbh/laravel-qr-code
```
##### Laravel 5.4 (5.5+ can skip this step)

You need to add provider and alias to your `config/app.php` file:

```php
<?php

'providers' => [

LaravelQRCode\Providers\QRCodeServiceProvider::class,

],


'aliases' => [

'QRCode' => LaravelQRCode\Facades\QRCode::class,

]
```
## <a id='code-types'></a>QR Code Types

Laravel QR Code Generator supports the following QR Codes:

- [Calendar Event](calendar.md)
- [Email Message](email.md)
- [Phone](phone.md)
- [SMS](sms.md)
- [Text](text.md)
- [URL](url.md)
- [meCard](me-card.md)
- [vCard v3](v-card.md)
- [Wi-fi Network Settings](wi-fi.md)

### Common Options

These options are available to any of the QR Code types above.

Option | Return value | Expected Values
-------|:-------------|:---------------
`setErrorCorrectionLevel($level)`|$this|'L','M','Q' or 'H'
`setSize(4)`|$this| Pixel size. 1 to 10
`setMargin(3)`|$this| 1 to 10
`setOutfile($file)`|$this|file path (public) and name.ext to save QR Code
`png()`| |stream (or save if outfile is set) QR Code as a PNG image
`svg()`| |stream (or save if outfile is set) QR Code as an SVG image

## Notes

- If you set an outfile, you **MUST make sure the path exists**.
Don't forget to **set filename extension** according to your output (.png or .svg).
- Since SVGs are scalable, use them to make complex QR Codes such as [Calendar Events](calendar.md), [meCards](me-card.md) and [vCards](v-card.md)
Loading

0 comments on commit 529fa54

Please sign in to comment.