{"id":19720747,"url":"https://github.com/square-bit/laravel-pt-rules","last_synced_at":"2025-10-29T04:18:34.426Z","repository":{"id":57058366,"uuid":"310326189","full_name":"square-bit/laravel-pt-rules","owner":"square-bit","description":"Validation rules relevant to Portugal","archived":false,"fork":false,"pushed_at":"2023-03-28T09:33:33.000Z","size":74,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-26T14:44:53.262Z","etag":null,"topics":["laravel-package","portugal","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/square-bit.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-11-05T14:35:39.000Z","updated_at":"2024-08-09T12:54:14.276Z","dependencies_parsed_at":"2024-08-09T13:11:00.867Z","dependency_job_id":null,"html_url":"https://github.com/square-bit/laravel-pt-rules","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.4444444444444444,"last_synced_commit":"cb6e376eb80ad0e548547a984b25b5bb1d479398"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square-bit%2Flaravel-pt-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square-bit%2Flaravel-pt-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square-bit%2Flaravel-pt-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square-bit%2Flaravel-pt-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/square-bit","download_url":"https://codeload.github.com/square-bit/laravel-pt-rules/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251585770,"owners_count":21613277,"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":["laravel-package","portugal","rules"],"created_at":"2024-11-11T23:12:23.438Z","updated_at":"2025-10-29T04:18:29.394Z","avatar_url":"https://github.com/square-bit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Set of validation rules relevant for Portugal\n\n[![Latest Stable Version](https://poser.pugx.org/square-bit/laravel-pt-rules/v)](//packagist.org/packages/square-bit/laravel-pt-rules)\n[![License](https://poser.pugx.org/square-bit/laravel-pt-rules/license)](//packagist.org/packages/square-bit/laravel-pt-rules)\n[![Total Downloads](https://poser.pugx.org/square-bit/laravel-pt-rules/downloads)](//packagist.org/packages/square-bit/laravel-pt-rules)\n\nThis package provides a set of Rules for Laravel 8 that are mainly useful to validate Portuguese ... stuff .... such as NIFs and CCs.\n\n## Installation\n\nVia Composer\n\n``` bash\n$ composer require square-bit/laravel-pt-rules\n```\n\n## Usage\nJust like any other validation rule, simply add the desired class to the list of rules.\nExample:\n```\nreturn Validator::make($data, [\n    [...]\n    'nif' =\u003e ['required', new NIF()],\n    [...]\n]);\n```\n\n## Available rules\n| Class      | Description                                                                                                                                                                                |\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| NIF        | Checks if the input is a valid Portuguese Fiscal ID number. Accepts both with and without the country preffix, ex: '123456789' or 'PT123456789'                                            |\n| CompanyNIF | Checks if the input is a valid Portuguese Fiscal ID number for a company (i.e. it starts with 5 or 9). Accepts both with and without the country preffix, ex: '523456789' or 'PT523456789' |\n| BI         | Checks if the input is a valid Portuguese Identification Card number. (requires the entire number, including the last digit)                                                               |\n| CC         | Checks if the input is a valid Portuguese Citizen Card number. (requires the full number, ex: \"12233456 7 ZZ0\")                                                                            |\n\n## Change log\n\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [contributing.md](contributing.md) for details and a todolist.\n\n## Security\n\nIf you discover any security related issues, please email info@square-bit.com instead of using the issue tracker.\n\n## Credits\n\n- [Squarebit][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nMIT. Please see the [license file](license.md) for more information.\n\n[link-author]: https://github.com/square-bit\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare-bit%2Flaravel-pt-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquare-bit%2Flaravel-pt-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare-bit%2Flaravel-pt-rules/lists"}