{"repo":"axlon/laravel-postal-code-validation","free":true,"listed":false,"github":"https://github.com/axlon/laravel-postal-code-validation","clone":"git clone https://github.com/axlon/laravel-postal-code-validation.git","description":"Worldwide postal code validation for Laravel and Lumen","language":"PHP","stars":389,"topics":["laravel","laravel-package","lumen","validation","postal-code","zip-code"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Postal Code Validation Adds postal code validation to Laravel, based on Google's libaddressinput. - Requirements - Installation - Usage - Available rules - Fluent API - Adding an error message - License - Attribution Requirements This package has the following requirements: - PHP 8.2 or greater - Laravel 12 or greater Installation You can install this package with Composer, by running the command below: If you have package discovery enabled, that's it, continue to the usage section. If you want to register the package manually, you can do this by adding the following line to your config/app.php file: Usage Postal code validation perfectly integrates into your Laravel application, you can use it just like you would any framework validation rule. Available rules This package adds the following validation rules: postal code:foo,bar,... The field under validation must be a valid postal code in at least one of the given countries. Arguments must be countries in ISO 3166-1 alpha-2 format. postal code with:foo,bar,... The field under validation must be a postal code in at least one of the countries in the given fields only if at least one of the specified fields is present. Fluent API If you prefer using a fluent object style over string based rules, that's also available: The same goes for the postal code with rule: Adding an error message To add a meaningful error message, add the following lines to resources/lang/{your language}/validation.php : The following placeholders","default_branch":null,"files":null,"tree":[],"storefront":"/r/axlon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/axlon/laravel-postal-code-validation/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}