European green-pass decoding and validation for php/laravel

Overview

Laravel Green Pass

laravel-greenpass

Author GitHub release (latest SemVer) Laravel >=6.0 Software License PSR2 Conformance Sponsor me! Packagist Downloads

laravel-greenpass is a package for the management of the European Green Pass (i.e. covid certification). The package allows easy validation and decoding of the GreenPass. It is also suited for Laravel since it provides a convenient custom validator for request validation.

Installation

Run the following command to install the latest applicable version of the package:

composer require robertogallea/laravel-greenpass

Laravel

In your app config, add the Service Provider to the $providers array (only for Laravel 5.4 or below):

'providers' => [
   ...
   robertogallea\LaravelGreenPass\GreenPassServiceProvider::class,
],

Lumen

In bootstrap/app.php, register the Service Provider

$app->register(robertogallea\LaravelGreenPass\GreenPassServiceProvider::class);

Validation

To validate a green pass, use the greenpass and greenpass_file keyword in your validation rules array

    public function rules()
    {
        return [
            'greenpass_string' => 'greenpass',
            
            //...
        ];
    }
    public function rules()
    {
        return [
            'greenpass_uploaded_file' => 'greenpass_file',
            
            //...
        ];
    }

Utility GreenPassDecoder class

A green pass can be read using the GreenPassDecoder service:

use robertogallea\LaravelGreenPass\GreenPassDecoder;

...

$greenpass = new GreenPassDecoder();

$result = $greenpass->decode('HC1:...');
var_dump($result);

// or

$result = $greenpass->decodeFile('/path/to/file');
var_dump($result);

You can also use the GreenPass facade:

use robertogallea\LaravelGreenPass\GreenPassDecoder;

...
$result = \GreenPass::decode('HC1:...');
var_dump($result);

// or

$result = \GreenPass::decodeFile('/path/to/file');
var_dump($result);
You might also like...
Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses related to services
Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses related to services

Kyle Kyle is a web application built with Laravel for web developers and small companies to efficiently track and stay on top of yearly expenses relat

A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system
A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system

A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system, demo is available at: http://ticketit.kordy.info/tickets

Laravel Angular Time Tracker is a simple time tracking application built on Laravel 5.2, Angular 2, and Bootstrap 3.

Laravel 5.2, Angular 2, and Bootstrap 3.3.* Time Tracker Laravel Angular Time Tracker is a simple time tracking application built on Laravel 5.2, Angu

Open source ERP software. Built on modern PHP and bootstrap 4. Easy and powerful.

FacturaScripts Open source ERP software. Built on modern PHP and bootstrap 4. Easy and powerful. Install Clone and deploy with composer and npm (compo

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Grav Grav is a Fast, Simple, and Flexible, file-based Web-platform. There is Zero installation required. Just extract the ZIP archive, and you are alr

Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.

⚠️ Note - Not the latest version This is the repository for Bolt 3. Please know that Bolt 5 has been released. If you are starting a new project, plea

Online personal and group chat application using HTML, CSS, JS, PHP,SQL and AJAX that allows users to create own groups, chat
Online personal and group chat application using HTML, CSS, JS, PHP,SQL and AJAX that allows users to create own groups, chat

Online personal and group chat application using HTML, CSS, JS, PHP,SQL and AJAX that allows users to create own groups, chat, make friends, check new notifications and edit functionality. Chat automatically updates using AJAX to allow for real-time chatting with other users collected from the database.

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML
Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML. The blockchain stores a previous hash value, current hash value, time, chat data, and a special key(nonce) used for encryption in each block (node).

UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.
UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.

UserFrosting 4.6 Branch Version Build Coverage Style master hotfix develop https://www.userfrosting.com If you simply want to show that you like this

Comments
  • Php 7.x compatibility

    Php 7.x compatibility

    Are you sure that php8.0 is the minimum requirement? If the package is compatible with laravel >= 6.0, I think would be better to make it compatible with php 7.x

    opened by albertovincenzi 7
  • Fix ci

    Fix ci

    Description

    Fix CI

    Motivation and context

    Why is this change required? What problem does it solve?

    If it fixes an open issue, please link to the issue here (if you write fixes #num or closes #num, the issue will be automatically closed when the pull is accepted.)

    How has this been tested?

    Please describe in detail how you tested your changes.

    Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc.

    Screenshots (if appropriate)

    Types of changes

    What types of changes does your code introduce? Put an x in all the boxes that apply:

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

    • [ ] I have read the CONTRIBUTING document.
    • [x] My pull request addresses exactly one patch/feature.
    • [x] I have created a branch for this patch/feature.
    • [ ] Each individual commit in the pull request is meaningful.
    • [ ] I have added tests to cover my changes.
    • [ ] If my change requires a change to the documentation, I have updated it accordingly.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    opened by Giacomo92 1
  • fix typo on README.md

    fix typo on README.md

    Description

    Fix a typo on README.md

    Motivation and context

    How has this been tested?

    Screenshots (if appropriate)

    Types of changes

    What types of changes does your code introduce? Put an x in all the boxes that apply:

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

    • [x] I have read the CONTRIBUTING document.
    • [x] My pull request addresses exactly one patch/feature.
    • [x] I have created a branch for this patch/feature.
    • [x] Each individual commit in the pull request is meaningful.
    • [ ] I have added tests to cover my changes.
    • [x] If my change requires a change to the documentation, I have updated it accordingly.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    opened by satboy78 1
  • Add strict validation option

    Add strict validation option

    Description

    Describe your changes in detail.

    Motivation and context

    Why is this change required? What problem does it solve?

    If it fixes an open issue, please link to the issue here (if you write fixes #num or closes #num, the issue will be automatically closed when the pull is accepted.)

    How has this been tested?

    Please describe in detail how you tested your changes.

    Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc.

    Screenshots (if appropriate)

    Types of changes

    What types of changes does your code introduce? Put an x in all the boxes that apply:

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

    • [ ] I have read the CONTRIBUTING document.
    • [ ] My pull request addresses exactly one patch/feature.
    • [ ] I have created a branch for this patch/feature.
    • [ ] Each individual commit in the pull request is meaningful.
    • [ ] I have added tests to cover my changes.
    • [ ] If my change requires a change to the documentation, I have updated it accordingly.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    opened by robertogallea 0
Releases(0.1.0)
Owner
Roberto Gallea
I am a PhD in computer science working at the University of Palermo, Italy. I am involved in all kinds of technical stuff, both software and hardware
Roberto Gallea
mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system

mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system. Dashboard features such as: Complete Dashboard, Custom Authentication, Email Verification, custom-login-register-forgot password (without jetstream).

Hasmukh Dharajiya 2 Sep 20, 2022
A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4

Larablog A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4 Table of contents F

Jeremy Kenedy 144 Oct 11, 2022
Created simple login system and chat type website using mysql database along with php and html , css and javascript.

Created simple login system and chat type website using mysql database along with php and html , css and javascript.

null 1 Jan 6, 2022
Automatic SASS-to-CSS compiling for Laravel 4 (and any other framework too), config-free, in pure PHP, works with latest SASS 3.2 .scss syntax, imports and mixins

laravel-sass Automatic Sass-to-CSS compiling for Laravel 4 (and any other framework by the way) while being in development. Every time you run your ap

Chris 71 Nov 29, 2022
Emoncms is an open-source web application for processing, logging and visualising energy, temperature and other environmental data and is part of the OpenEnergyMonitor project.

Emoncms is an open-source web application for processing, logging and visualising energy, temperature and other environmental data and is part of the OpenEnergyMonitor project.

Emoncms 1.1k Dec 22, 2022
This prj we have two NODEMCU ( ESP8266) and two RFID_RC522 and some rfid tags we used ARDUINO IDE on NODEMCU and running server with XAMPP

This prj we have two NODEMCU ( ESP8266) and two RFID_RC522 and some rfid tags we used ARDUINO IDE on NODEMCU and running server with XAMPP

Mohammadamir Soltanzadeh 2 Mar 29, 2022
Rafa Cake and Bakery is a web-based application project that aims to introduce Rafa Cake and Bakery, introduce what products are sold and can also order them via Whatsapp.

Rafa-cake-and-bakery Rafa Cake and Bakery is a web-based application project that aims to introduce Rafa Cake and Bakery, introduce what products are

Aan Evian Nanda 2 Jun 19, 2022
A free and open-source Laravel 5.5 and VueJS (SPA) Ticket system

Ticket-conductor A Laravel 5.5 and VueJS (SPA) Ticket system app (This project was mostly for myself to learn Vue Js a bit better, and will not be mai

Casper Bottelet 51 Dec 17, 2022
Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.

About Vote based Question & Answer site built using Laravel 5.4, material design, x-editable, jQuery Upvote and email/database notifications. Register

Jorge A. Gonzalez 116 Nov 2, 2022
Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.

About Vote based Question & Answer site built using Laravel 5.4, material design, x-editable, jQuery Upvote and email/database notifications. Register

Jorge A. Gonzalez 116 Nov 2, 2022