{"id":17966190,"url":"https://github.com/pacerit/laravel-polish-validation-rules","last_synced_at":"2025-08-24T04:06:21.757Z","repository":{"id":41049657,"uuid":"201912664","full_name":"pacerit/laravel-polish-validation-rules","owner":"pacerit","description":"Simple Polish Validation rules for Laravel and Lumen framework","archived":false,"fork":false,"pushed_at":"2024-05-05T18:00:01.000Z","size":77,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T08:25:37.797Z","etag":null,"topics":["card-number","id-card","id-card-number","laravel","lumen","lumen-framework","nip","passport-number","pesel","php","polish","polish-passport-number","polish-validation","post-code","pwz","pwz-number","regon","validation","validation-rules"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pacerit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-12T10:55:55.000Z","updated_at":"2024-09-29T23:11:12.000Z","dependencies_parsed_at":"2024-05-05T18:27:56.250Z","dependency_job_id":"7ecf6dbf-20ab-43cf-aed2-d4a245f53042","html_url":"https://github.com/pacerit/laravel-polish-validation-rules","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":"0.18181818181818177","last_synced_commit":"1218019494f7bb98199c167e2428512e6e33b3b2"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacerit%2Flaravel-polish-validation-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacerit%2Flaravel-polish-validation-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacerit%2Flaravel-polish-validation-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pacerit%2Flaravel-polish-validation-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pacerit","download_url":"https://codeload.github.com/pacerit/laravel-polish-validation-rules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222052573,"owners_count":16922728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["card-number","id-card","id-card-number","laravel","lumen","lumen-framework","nip","passport-number","pesel","php","polish","polish-passport-number","polish-validation","post-code","pwz","pwz-number","regon","validation","validation-rules"],"created_at":"2024-10-29T13:08:11.451Z","updated_at":"2025-03-25T07:31:26.303Z","avatar_url":"https://github.com/pacerit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Polish Validation Rules\n![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/pacerit/laravel-polish-validation-rules?label=Version)\n![GitHub](https://img.shields.io/github/license/pacerit/laravel-polish-validation-rules?label=License)\n![Packagist](https://img.shields.io/packagist/dt/pacerit/laravel-polish-validation-rules?label=Downloads)\n![PHP from Packagist](https://img.shields.io/packagist/php-v/pacerit/laravel-polish-validation-rules?label=PHP)\n[![StyleCI](https://github.styleci.io/repos/201912664/shield?branch=master)](https://github.styleci.io/repos/201912664)\n[![\u003cPacerIT\u003e](https://circleci.com/gh/pacerit/laravel-polish-validation-rules.svg?style=svg)](https://circleci.com/gh/pacerit/laravel-polish-validation-rules)\n\nSimple Polish Validation rules for Laravel and Lumen framework\n\n## Installation\nYou can install this package by composer:\n\n    composer require pacerit/laravel-polish-validation-rules\n    \nFor customize validaiton messages run:\n\n    php artisan vendor:publish --provider \"PacerIT\\LaravelPolishValidationRules\\Providers\\LaravelPolishValidationRulesServiceProvider\"\n    \n### Version compatibility\n#### Laravel/Lumen\nFramework | Package | Note\n:---------|:--------|:------\n5.8.x      | ^1.x.x  | No longer maintained.\n6.0.x      | ^2.x.x  | No longer maintained.\n7.x.x      | ^3.x.x  | No longer maintained.\n8.x.x      | ^4.x.x  | PHP ^8.0 Supported from 4.0.3, Bug fixes only. No longer maintained.\n9.x.x      | ^5.x.x  |\n10.x.x     | ^6.x.x  |\n11.x.x     | ^7.x.x  |\n12.x.x     | ^8.x.x  |\n\n## Rules\n\n1. 'PESEL' - validate [PESEL](https://pl.wikipedia.org/wiki/PESEL) number. We can validate additional parameters:\n   * Gender - check if gender value in PESEL\n     * `gender_male`\n     * `gender_female`\n   * Birth date - checking if birth date decoded from PESEL number is before or after date defined in rules\n     * `born_before,Y-m-d` - i.e. `PESEL:born_before,2022-01-01`\n     * `born_after,Y-m-d` - i.e. `PESEL:born_after,2000-01-01`\n2. 'REGON' - validate [REGON](https://pl.wikipedia.org/wiki/REGON) number\n3. 'NIP' - validate [NIP](https://pl.wikipedia.org/wiki/NIP) number\n4. 'id_card_number' - validate Polish ID Card number\n5. 'post_code' - validate Polish post codes. By default accept codes in format 00-000 and 00000. You can change this with options:\n   * with_dash - only post codes with format 00-000 are valid\n   * without_dash - only post code with format 00000 are valid\n6. 'PWZ' - validate PWZ (Prawo wykonywania zawodu lekarza/farmaceuty) numer (more information [HERE](https://nil.org.pl/rejestry/centralny-rejestr-lekarzy/zasady-weryfikowania-nr-prawa-wykonywania-zawodu))\n7. 'passport_number' - validate Polish passport number\n\n## Usage example\n\nWithout optional parameters\n```php\n$validator = Validator::make(\n    $request-\u003eall(),\n    [\n        'post_code'  =\u003e 'post_code',\n        'pesel'      =\u003e 'PESEL',\n        'nip_number' =\u003e 'NIP',\n    ]\n);\n```\n\nWith optional parameters\n```php\n$validator = Validator::make(\n    $request-\u003eall(),\n    [\n        'post_code' =\u003e 'post_code:without_dash',\n        'pesel'     =\u003e 'PESEL:gender_female',\n    ]\n);\n```\n\nMultiple options\n```php\n$validator = Validator::make(\n    $request-\u003eall(),\n    [\n        'pesel' =\u003e 'PESEL:gender_male:born_before,2022-01-01:born_after,2000-01-01',\n    ]\n);\n```\n\n## Code Authors\n\nThe algorithms used in the functions are based on existing solutions. Below are links to the sources:\n\n* PESEL\n  * checksum checking algorithm - [http://phpedia.pl/wiki/PESEL](http://phpedia.pl/wiki/PESEL)\n  * extract/validate bith date - [KKSzymanowski/PESEL](https://github.com/KKSzymanowski/PESEL/blob/master/src/Pesel.php)\n* REGON - [http://phpedia.pl/wiki/REGON](http://phpedia.pl/wiki/REGON)\n* NIP - [http://phpedia.pl/wiki/NIP](http://phpedia.pl/wiki/NIP)\n* id_card_number - [http://www.algorytm.org](http://www.algorytm.org/numery-identyfikacyjne/numer-dowodu-osobistego/do-php.html)\n\n## Changelog\n\nGo to the [Changelog](CHANGELOG.md) for a full change history of the package.\n\n## Testing\n\n    composer test\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within package, please send an e-mail to Wiktor Pacer\nvia [kontakt@pacerit.pl](mailto:kontakt@pacerit.pl). All security vulnerabilities will be promptly addressed.\n\n## License\n\nThis package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacerit%2Flaravel-polish-validation-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpacerit%2Flaravel-polish-validation-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpacerit%2Flaravel-polish-validation-rules/lists"}