This package contains validatiors of data used in Poland (PESEL, NIP, REGON etc.)

Overview

Validation of Poland specific data

License: MIT

#Polish Version here#

PL: Ten pakiet zawiera walidatory danych używanych w Polsce (PESEL, NIP, REGON etc.)
EN :This package contains validators of data used in Poland (PESEL, NIP, REGON etc.)

Install

composer require illusionpro/validate-polish

Dostępne walidatory / Available validators:

Pesel Validation
NIP Validation

PESEL Validation

Walidator
✔️ Checks if PESEL contains 11 digits and no characters
✔️ Checks the control sum using the official algorithm

Dodatkowo zwraca
✔️ Date of birth
✔️ Gender

Usage:

use Illusionpro\ValidatePolish\Pesel;  

$pesel = new Pesel($peselNumber);
$pesel->validate()

Result:

bool(true) ["gender"]=> string(1) "M" ["pesel"]=> string(11) "00112233445" ["birthDate"]=> array(3) { ["year"]=> string(4) "1980" ["month"]=> string(2) "12" ["day"]=> string(2) "30" } ["error"]=> bool(false) ["errorMessage"]=> NULL }">
array(5) {
  ["isValid"]=> bool(true)
  ["gender"]=> string(1) "M"
  ["pesel"]=> string(11) "00112233445"
  ["birthDate"]=>  array(3) {
        ["year"]=> string(4) "1980"
        ["month"]=> string(2) "12"
        ["day"]=> string(2) "30"
    }
  ["error"]=> bool(false)
  ["errorMessage"]=> NULL
}

NIP Validation

Validator
✔️ Removes comas and dashes from the string. This enables different formatting styles.
(5260251109, 526-025-11-09, 52 60 25 11 09).
✔️ Verifies if NIP consists of 10 digits.
✔️ Checks the control sum using the official algorithm.

Usage:

use Illusionpro\ValidatePolish\Nip;  

$nip = new Nip('526-025-11-09');
$nip->validate()

Result:

bool(true) ["nip"]=> string(10) "5260251109" ["error"]=> bool(false) ["errorMessage"]=> NULL }">
array(5) {
  ["isValid"]=> bool(true)
  ["nip"]=> string(10) "5260251109"
  ["error"]=> bool(false)
  ["errorMessage"]=> NULL
}

There are also other dictionary options available:

✔️ Voivodship

Usage:

use Illusionpro\ValidatePolish\Dictionary;  

$provinces = Dictionary::getProvinces(); // for voivodship list
$province = Dictionary::getProvince($key); // to retrieve a specific voivodship based on the key from the list

✔️ NFZ list with code

Usage:

use Illusionpro\ValidatePolish\Dictionary;  

$nfzList = Dictionary::getNfzList(); // to list NFZ branches
$singleNfz = Dictionary::getNfz($key); // to retrieve a specific NFZ branch

Result single:

Array
(
    [code] => 11
    [name] => Pomeranian branch of NFZ
)
You might also like...
Libraries and scripts for crawling the TYPO3 page tree. Used for re-caching, re-indexing, publishing applications etc.

Libraries and scripts for crawling the TYPO3 page tree. Used for re-caching, re-indexing, publishing applications etc.

The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

📦 "PHP type names" contains the list of constants for the available PHP data types.

PHP type names PHP type names 📄 Description Simple library containing the list of constants for the available PHP data types. Use those constant type

DataLoaderPhp is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.

DataLoaderPHP is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.

The package contains a bootstrap for running Yii3 web application.
The package contains a bootstrap for running Yii3 web application.

Yii Web Runner The package contains a bootstrap for running Yii3 web application. Requirements PHP 8.0 or higher. Installation The package could be in

The package contains a bootstrap for running Yii3 console application.
The package contains a bootstrap for running Yii3 console application.

Yii Console Runner The package contains a bootstrap for running Yii3 console application. Requirements PHP 8.0 or higher. Installation The package cou

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat, helping you deal with VAT legislation for businesses based in the EU.

This package contains a PHP implementation to solve 3D bin packing problems.

3D Bin Packager This package contains a PHP implementation to solve 3d bin packing problems based on gedex implementation on Go and enzoruiz implement

Simple handler system used to power clients and servers in PHP (this project is no longer used in Guzzle 6+)

RingPHP Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function. RingPHP be used to power HTTP clie

A simple Laravel package for generating download links with options such as expire time, IP restrictions, etc.

Generate download links in your Laravel applications This package allows you to generate download links for files. Once installed you can do stuff lik

Package to fetch cryptocurrency price, market value, assets etc. using coincap API endpoints

cryptocap-pkg Package to fetch cryptocurrency price, market value, assets etc. using coincap API endpoints. This package was developed to work with co

Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages.

SLIM JAM Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages. This project aims to take a

This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

This repository contains research materials and dev notes for the DSM research

DSM Research This repository contains a loosely-organized information regarding the processes of DSM loading. A lot of information present here was co

This repository contains the sources of OXID eShop Community Edition Core Component.
This repository contains the sources of OXID eShop Community Edition Core Component.

OXID eShop This repository contains the sources of OXID eShop Community Edition Core Component. About OXID eShop: OXID eShop is a flexible open source

ChestRandomBP: This plugin generates chests in random places within a specific world. Where you can customize what each one of them contains, the time and the world of spawning.
ChestRandomBP: This plugin generates chests in random places within a specific world. Where you can customize what each one of them contains, the time and the world of spawning.

ChestRandomBP ChestRandomBP: This plugin generates chests, it works PocketMine-MP and random places within a specific world. Where you can customize w

This repository contains collection of portfolio's .

Welcome to the repository 😍 This repository contains collection of portfolio's . You can add your own repository. How to contribute to this repositor

website that contains solutions to make IT support easier to solve problems.

Project This website is manual guide when you face a problem and don't want to call IT support. hr always call for helping with repeated problem. I fe

Releases(v1.1.0)
Owner
Pawel Lukas
Pawel Lukas
🔒 Laravel validation rule that checks if a password has been exposed in a data breach.

?? Laravel Password Exposed Validation Rule This package provides a Laravel validation rule that checks if a password has been exposed in a data breac

Jordan Hall 85 Apr 26, 2022
An extensible validation library for your data with sane defaults.

Hird Hirds, also known as housecarls, was a gathering of hirdmen, who functioned as the king's personal guards during the viking age and the early mid

Asko Nõmm 13 Apr 23, 2022
🔒 Laravel validation rule that checks if a password has been exposed in a data breach.

?? Laravel Password Exposed Validation Rule This package provides a Laravel validation rule that checks if a password has been exposed in a data breac

Jordan Hall 85 Apr 26, 2022
PHP library for ArCaptcha. This package supports PHP 7.3+.

PHP ArCaptcha Library PHP library for ArCaptcha. This package supports PHP 7.3+. List of contents PHP ArCaptcha Library List of contents Installation

Mohammad Abbasi 10 Aug 12, 2022
A simple package to validate against common passwords and help keep your application secure.

common-passwords A simple package to validate against common passwords and help keep your application secure. composer require crumbls/common-password

Crumbls 4 Oct 16, 2021
A PHP package for validating/generating/formatting an IRS document number (CPF/CNPJ)

A PHP package for validating/generating/formatting an IRS document number (CPF/CNPJ)

null 7 Dec 15, 2022
This package provides tools to validate and sanitize objects and arrays.

Aura.Filter This package provides tools to validate and sanitize objects and arrays. Foreword Installation This library requires PHP 7.2 or later; we

Aura for PHP 153 Jan 2, 2023
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Melek Berita Backend is a service for crawling data from various websites and processing the data to be used for news data needs.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Chacha Nurholis 2 Oct 9, 2022
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

Matomo Analytics 2.4k Jan 5, 2023