{"id":16025208,"url":"https://github.com/lucasgiovanny/laravel-serpro-datavalid","last_synced_at":"2026-03-05T09:03:59.562Z","repository":{"id":62519707,"uuid":"273654737","full_name":"lucasgiovanny/laravel-serpro-datavalid","owner":"lucasgiovanny","description":"Laravel package to use Serpro Datavalid API","archived":false,"fork":false,"pushed_at":"2023-04-06T15:32:02.000Z","size":121,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"1.x","last_synced_at":"2025-07-19T20:21:25.001Z","etag":null,"topics":["datavalid","laravel","php","serpro","serpro-datavalid"],"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/lucasgiovanny.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"lucasgiovanny"}},"created_at":"2020-06-20T06:50:08.000Z","updated_at":"2023-03-24T11:21:37.000Z","dependencies_parsed_at":"2025-04-10T04:36:53.171Z","dependency_job_id":"7741c44d-3d4e-4b36-926e-8adf2149809f","html_url":"https://github.com/lucasgiovanny/laravel-serpro-datavalid","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lucasgiovanny/laravel-serpro-datavalid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgiovanny%2Flaravel-serpro-datavalid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgiovanny%2Flaravel-serpro-datavalid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgiovanny%2Flaravel-serpro-datavalid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgiovanny%2Flaravel-serpro-datavalid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasgiovanny","download_url":"https://codeload.github.com/lucasgiovanny/laravel-serpro-datavalid/tar.gz/refs/heads/1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasgiovanny%2Flaravel-serpro-datavalid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["datavalid","laravel","php","serpro","serpro-datavalid"],"created_at":"2024-10-08T19:41:46.032Z","updated_at":"2026-03-05T09:03:59.503Z","avatar_url":"https://github.com/lucasgiovanny.png","language":"PHP","funding_links":["https://github.com/sponsors/lucasgiovanny"],"categories":[],"sub_categories":[],"readme":"# Laravel Serpro Datavalid\n\n\u003cimg src=\"art/logo.png\" width=\"500\" alt=\"Laravel Serpro Datavalid\"\u003e\n\nThis package makes it easy to use Serpro [Datavalid](https://servicos.serpro.gov.br/datavalid/) API with Laravel framework.\n\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/lucasgiovanny/laravel-serpro-datavalid?label=last%20version)\n![GitHub](https://img.shields.io/github/license/lucasgiovanny/laravel-serpro-datavalid)\n\n## Contents\n\n- [Installation](#installation)\n\n- [Usage](#usage)\n\n## Installation\n\nThis package can be installed via composer:\n\n`composer require lucasgiovanny/laravel-serpro-datavalid`\n\n## Usage\n\n1. Add your credentials to `.env` file\n\n```\nSERPRO_DATAVALID_CONSUMER_KEY=\nSERPRO_DATAVALID_CONSUMER_SECRET=\nSERPRO_DATAVALID_SANDBOX=false\n```\n\n2. To use this package, you just need to import the Person Facades.\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n```\n\n### Available methods\n\n - [`rawValidation`](#rawValidation): Make a raw validation with any data you need to validate according to [Datavalid API Docs](https://apidocs.datavalidp.estaleiro.serpro.gov.br).\n - [`validateName`](#validateName): Returns whether the name belongs to the CPF and its rate of assertiveness.\n - [`validateGender`](#validateGender): Returns whether the CPF has this gender.\n - [`isBrazilian`](#isBrazilian): Returns whether the person to whom this CPF belongs is Brazilian or not.\n - [`validateParentsName`](#validateParentsName): Returns whether the parents name belongs to the CPF and its rate of assertiveness.\n - [`isCPFRegular`](#isCPFRegular): Returns if CPF is regular with Brazilian government.\n - [`validatePhoto`](#validatePhoto): Returns if the person in the photo is the person that owns this CPF number.\n\n#### rawValidation\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n|answers|*array* (**required**)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$data = [\n'nome'  =\u003e  \"João da Silva\",\n'sexo' =\u003e 'M'\n'situacao_cpf'  =\u003e  'regular',\n];\n\n$validation = Person::rawValidation(\"00000000000\", $data);\n```\n\n*Please, see the [Data Valid API docs](https://apidocs.datavalidp.estaleiro.serpro.gov.br) for a list of all the propriety that can be checked.*\n\n#### validateName\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n|name|*string* (**required**)|\n|getSimilarity|*bool* (default: false)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$validation = Person::validateName(\"00000000000\", \"João da Silva\");\n//return true or false;\n$validation = Person::validateName(\"00000000000\", \"João da Silva\", true);\n//return an object, like:\n\t// $validation-\u003enome = true;\n\t// $validation-\u003enome_similaridade = 0.99\n```\n\n#### validateGender\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n|gender|*string* (**required**)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$validation = Person::validateGender(\"00000000000\", \"F\"); // gender needs to be \"F\" or \"M\"\n//return true or false;\n```\n\n#### isBrazilian\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$validation = Person::isBrazilian(\"00000000000\");\n//return true or false;\n```\n\n#### validateParentsName\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n|parents|*array* (**required**)|\n|getSimilarity|*bool* (default: false)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$parents = [\n\t'mother_name' =\u003e 'Eurica Magalhães Souza';\n\t'father_name' =\u003e 'Frederico Fagundes Souza';\n]; // you can check just one of the names\n\n$validation = Person::validateParentsName(\"00000000000\", $parents);\n//return an object with \"mother_name\" and \"father_name\" true or false values;\n\n$validation = Person::validateParentsName(\"00000000000\", $parents, true);\n//return an object with \"mother_name\" and \"father_name\" true or false values, \n//and \"mother_name_similarity\" and \"father_name_similarity\" numbers,\n//just like in validateName method.\n```\n\n#### isCPFRegular\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$validation = Person::isCPFRegular(\"00000000000\");\n//return true or false;\n```\n\n#### validatePhoto\n\n|Param| Type |\n|--|--|\n|cpf|*string* (**required**)|\n|photo|*string* (**required**)\n\nExample:\n\n```php\nuse  LucasGiovanny\\SerproDataValid\\Person;\n\n$validation = Person::validatePhoto(\"00000000000\", base64_encode($photo));\n//return true or false;\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\nTest needs to be written. Feel free to collaborate.\n\n## Security\n\nIf you discover any security related issues, please email lucasgiovanny@gmail.com instead of using the issue tracker.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Lucas Giovanny](https://github.com/lucasgiovanny)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasgiovanny%2Flaravel-serpro-datavalid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasgiovanny%2Flaravel-serpro-datavalid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasgiovanny%2Flaravel-serpro-datavalid/lists"}