Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Pesel Validator

Pesel Validator Laravel Package

pajerdesign/pesel-validator

Laravel validator for Polish PESEL numbers. Adds a simple validation rule that checks length, digits, and checksum, and can extract the birth date and gender encoded in the number. Drop it into your form requests or validators to reject invalid PESEL input with clear error messages.

View on GitHub
Deep Wiki
Context7

.

Frequently asked questions about Pesel Validator
How do I install the pajerdesign/pesel-validator package in Laravel?
Install the package with Composer using composer require pajerdesign/pesel-validator. After installation, check the package README for any Laravel service provider or configuration steps. The package is intended to be used as a Laravel validation rule in form requests or validators.
How do I use the PESEL validation rule in a Laravel FormRequest?
Add the PESEL validation rule provided by the package to the rules array for your pesel field in a FormRequest. The rule checks length, digits, and checksum and returns a validation error when the value is invalid. Use it alongside required or nullable depending on whether the field is mandatory.
Does this validator check the PESEL checksum, not just the length?
Yes. The package validates the PESEL length, confirms that the value contains only digits, and checks the PESEL checksum. This catches invalid numbers that a simple length or numeric check would miss.
Can I extract birth date and gender from a PESEL number with this package?
Yes, the package is designed to extract the birth date and gender encoded in a PESEL number. Validate the PESEL first, then use the extraction feature so you do not process invalid input. The README should show the exact method or helper to call.
Which Laravel versions does pajerdesign/pesel-validator support?
The package is built for Laravel, but the exact supported Laravel versions depend on its composer.json requirements. Check those requirements before installing, especially on older Laravel applications. Composer will resolve a compatible package version if one exists.
How do I customize the validation error message for an invalid PESEL?
In Laravel you can usually customize validation messages in your FormRequest messages method or by passing a custom message when defining the rule. Check the package documentation for the exact message key or rule name to target. A clear message such as "The PESEL number is invalid" works well for users.
Can I use this package outside Laravel in plain PHP?
This package is described as a Laravel validator, so its primary use case is Laravel form requests and validators. For plain PHP, you may need to use the underlying validation logic if it is exposed, or choose a standalone PESEL library instead. Review the source and README before relying on it outside Laravel.
How should I test PESEL validation in my Laravel application?
Write Laravel feature or unit tests that submit valid and invalid PESEL values and assert the expected validation results. Test the FormRequest or validator directly so you cover the rule integration. Use known test PESEL numbers from the package documentation or test fixtures rather than real personal data.
Is pajerdesign/pesel-validator production-ready and actively maintained?
Review the repository activity, releases, open issues, and test coverage before using it in production. The package has a focused purpose, but you should confirm Laravel version compatibility for your application. Pin a version in composer.json and add your own validation tests as a safeguard.
What are alternatives to this package for validating Polish PESEL numbers in Laravel?
You can use a broader Polish validation package, wrap a standalone PESEL library in a custom Laravel rule, or implement the PESEL checksum logic yourself. This package is focused specifically on PESEL validation and Laravel integration. Compare maintenance status, Laravel compatibility, and whether you need birth date and gender extraction.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin