PHPackages                             lucasgiovanny/laravel-serpro-datavalid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lucasgiovanny/laravel-serpro-datavalid

ActiveLibrary[API Development](/categories/api)

lucasgiovanny/laravel-serpro-datavalid
======================================

Laravel package to easily use Serpro Datavalid API

v1.0.0(3y ago)1592MITPHPPHP ^8.0

Since Jun 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lucasgiovanny/laravel-serpro-datavalid)[ Packagist](https://packagist.org/packages/lucasgiovanny/laravel-serpro-datavalid)[ GitHub Sponsors](https://github.com/lucasgiovanny)[ RSS](/packages/lucasgiovanny-laravel-serpro-datavalid/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (9)Used By (0)

Laravel Serpro Datavalid
========================

[](#laravel-serpro-datavalid)

[![Laravel Serpro Datavalid](art/logo.png)](art/logo.png)

This package makes it easy to use Serpro [Datavalid](https://servicos.serpro.gov.br/datavalid/) API with Laravel framework.

[![GitHub release (latest by date)](https://camo.githubusercontent.com/50602fa93f30b02c0a49da7e1a1346c4d2bb8183c3b3514a79eebc140453fc43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c7563617367696f76616e6e792f6c61726176656c2d73657270726f2d6461746176616c69643f6c6162656c3d6c61737425323076657273696f6e)](https://camo.githubusercontent.com/50602fa93f30b02c0a49da7e1a1346c4d2bb8183c3b3514a79eebc140453fc43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c7563617367696f76616e6e792f6c61726176656c2d73657270726f2d6461746176616c69643f6c6162656c3d6c61737425323076657273696f6e)[![GitHub](https://camo.githubusercontent.com/e419723dde5377ffc68520e57c8ef011e756b85c6bfdf70dcb0e69bd1c7ebcbd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c7563617367696f76616e6e792f6c61726176656c2d73657270726f2d6461746176616c6964)](https://camo.githubusercontent.com/e419723dde5377ffc68520e57c8ef011e756b85c6bfdf70dcb0e69bd1c7ebcbd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c7563617367696f76616e6e792f6c61726176656c2d73657270726f2d6461746176616c6964)

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)

Installation
------------

[](#installation)

This package can be installed via composer:

`composer require lucasgiovanny/laravel-serpro-datavalid`

Usage
-----

[](#usage)

1. Add your credentials to `.env` file

```
SERPRO_DATAVALID_CONSUMER_KEY=
SERPRO_DATAVALID_CONSUMER_SECRET=
SERPRO_DATAVALID_SANDBOX=false

```

2. To use this package, you just need to import the Person Facades.

```
use  LucasGiovanny\SerproDataValid\Person;
```

### Available methods

[](#available-methods)

- [`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).
- [`validateName`](#validateName): Returns whether the name belongs to the CPF and its rate of assertiveness.
- [`validateGender`](#validateGender): Returns whether the CPF has this gender.
- [`isBrazilian`](#isBrazilian): Returns whether the person to whom this CPF belongs is Brazilian or not.
- [`validateParentsName`](#validateParentsName): Returns whether the parents name belongs to the CPF and its rate of assertiveness.
- [`isCPFRegular`](#isCPFRegular): Returns if CPF is regular with Brazilian government.
- [`validatePhoto`](#validatePhoto): Returns if the person in the photo is the person that owns this CPF number.

#### rawValidation

[](#rawvalidation)

ParamTypecpf*string* (**required**)answers*array* (**required**)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$data = [
'nome'  =>  "João da Silva",
'sexo' => 'M'
'situacao_cpf'  =>  'regular',
];

$validation = Person::rawValidation("00000000000", $data);
```

*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.*

#### validateName

[](#validatename)

ParamTypecpf*string* (**required**)name*string* (**required**)getSimilarity*bool* (default: false)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$validation = Person::validateName("00000000000", "João da Silva");
//return true or false;
$validation = Person::validateName("00000000000", "João da Silva", true);
//return an object, like:
	// $validation->nome = true;
	// $validation->nome_similaridade = 0.99
```

#### validateGender

[](#validategender)

ParamTypecpf*string* (**required**)gender*string* (**required**)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$validation = Person::validateGender("00000000000", "F"); // gender needs to be "F" or "M"
//return true or false;
```

#### isBrazilian

[](#isbrazilian)

ParamTypecpf*string* (**required**)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$validation = Person::isBrazilian("00000000000");
//return true or false;
```

#### validateParentsName

[](#validateparentsname)

ParamTypecpf*string* (**required**)parents*array* (**required**)getSimilarity*bool* (default: false)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$parents = [
	'mother_name' => 'Eurica Magalhães Souza';
	'father_name' => 'Frederico Fagundes Souza';
]; // you can check just one of the names

$validation = Person::validateParentsName("00000000000", $parents);
//return an object with "mother_name" and "father_name" true or false values;

$validation = Person::validateParentsName("00000000000", $parents, true);
//return an object with "mother_name" and "father_name" true or false values,
//and "mother_name_similarity" and "father_name_similarity" numbers,
//just like in validateName method.
```

#### isCPFRegular

[](#iscpfregular)

ParamTypecpf*string* (**required**)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$validation = Person::isCPFRegular("00000000000");
//return true or false;
```

#### validatePhoto

[](#validatephoto)

ParamTypecpf*string* (**required**)photo*string* (**required**)Example:

```
use  LucasGiovanny\SerproDataValid\Person;

$validation = Person::validatePhoto("00000000000", base64_encode($photo));
//return true or false;
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

Test needs to be written. Feel free to collaborate.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Lucas Giovanny](https://github.com/lucasgiovanny)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~127 days

Recently: every ~212 days

Total

9

Last Release

1133d ago

Major Versions

0.x-dev → v1.0.02023-03-24

PHP version history (2 changes)v0.1PHP &gt;=7.2

v1.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8487f2121d7a9d801d87e5d28efe83dea1549b6ba8e2fc6519edea6d66eaa31a?d=identicon)[lucasgiovanny](/maintainers/lucasgiovanny)

---

Top Contributors

[![lucasgiovanny](https://avatars.githubusercontent.com/u/4853801?v=4)](https://github.com/lucasgiovanny "lucasgiovanny (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

datavalidlaravelphpserproserpro-datavalidlaravelSERPROdatavalid

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lucasgiovanny-laravel-serpro-datavalid/health.svg)

```
[![Health](https://phpackages.com/badges/lucasgiovanny-laravel-serpro-datavalid/health.svg)](https://phpackages.com/packages/lucasgiovanny-laravel-serpro-datavalid)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
