Download the PHP package x-laravel/validation-tr-citizen-number-extend without Composer
On this page you can find all versions of the php package x-laravel/validation-tr-citizen-number-extend. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download x-laravel/validation-tr-citizen-number-extend
More information about x-laravel/validation-tr-citizen-number-extend
Files in x-laravel/validation-tr-citizen-number-extend
Package validation-tr-citizen-number-extend
Short Description Turkey citizen number (TC No) validation extend package for Laravel.
License MIT
Informations about the package validation-tr-citizen-number-extend
Turkish Citizen Number Validation for Laravel
A Laravel validation rule for Turkish citizen numbers (T.C. Kimlik No). It wraps x-adam/tr-citizen-number-validation, which checks the number offline against the official checksum rules — no network access, no dependencies beyond Laravel itself.
Requirements
| Package version | PHP | Laravel |
|---|---|---|
| 2.x | 8.2+ | 12, 13 |
| 1.x | 7.0+ | 5.5+ |
Installation
The service provider is registered through package discovery.
Usage
Rule object
The rule object comes with Turkish and English error messages and picks the one matching the application locale.
String alias
For the string alias Laravel resolves the error message the way it does for any extended rule, so
add a line to your application's lang/xx/validation.php:
Without it Laravel falls back to the raw key validation.tr_citizen_number. You can also pass an
inline message through the validator's messages argument or a form request's messages() method.
Either form accepts int and string values; anything else — arrays, booleans, floats — fails
validation instead of throwing.
Customising the messages
To change the rule object's messages, publish the language files and edit them:
They land in lang/vendor/tr-citizen-number/{tr,en}/validation.php.
What it checks
The rule answers "is this a well-formed citizen number?" — length, leading digit and both check digits. It does not verify that the number belongs to a particular person; that requires the KPS service of the Turkish Directorate of Population and Citizenship Affairs, which is only available to institutions with a membership.
Testing
The suite runs on Orchestra Testbench against every supported Laravel and PHP combination in CI, along with PHPStan (Larastan) at its highest level.
License
Open source software licensed under the MIT license.
All versions of validation-tr-citizen-number-extend with dependencies
illuminate/contracts Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/validation Version ^12.0 || ^13.0
x-adam/tr-citizen-number-validation Version ^5.0