jansenfelipe/cpf-gratis
A compact PHP package for handling Brazilian CPF numbers. It makes it easy to validate CPF values, reject invalid documents, and add CPF checks to Laravel validators or any PHP project with minimal setup and no external dependencies.
Architecture fit. jansenfelipe/cpf-gratis is a thin, synchronous PHP client that scrapes the Receita Federal CPF consultation page to return registration data (name, status, birth date, etc.) without a paid provider. That makes it a best-effort enrichment utility, not an authoritative identity source. It fits low-volume, non-blocking use cases (internal admin lookups, back-office validation, data cleanup) — not KYC/onboarding, credit decisioning, or any flow where a wrong or missing answer has financial or regulatory consequences. The package's 3.39 opportunity score and 194 stars reflect that it is a single-maintainer wrapper around a third-party web page, not a maintained API SDK.
Integration feasibility. Composer-installable and small surface area, so a spike is cheap (hours, not days). Two caveats: (1) it is a plain PHP package — expect to write your own Laravel service provider/facade binding and config; (2) its real dependency is not code but the Receita Federal site's HTML, and the CPF consultation page has historically used a captcha/anti-bot mechanism. Confirm whether the package depends on a captcha-solving service, a proxy, or a legacy endpoint before assuming "free" means "no external cost."
Technical risk. High, in three layers:
Key questions.
Stack fit. Fits a Laravel/PHP monolith as an isolated adapter. The correct pattern is a CpfLookup interface with two implementations: a scraping adapter wrapping this package and a commercial-provider adapter. That keeps the "free" option swappable and prevents it from leaking into domain code. Do not let controllers call the package directly.
Migration path.
Compatibility. Watch for PHP version constraints and Guzzle/HTTP-client version conflicts with Laravel's Http facade and existing dependencies. Because it is framework-agnostic, most version conflicts are resolvable, but pin and test in CI. If it bundles a DOM parser (phpQuery or similar), check that dependency is still maintained.
Sequencing. Scrape-only-in-shadow-mode → compare against provider results → promote only for non-critical paths. Treat the paid provider as primary and this package as a cost-reduction experiment, never the reverse.
Maintenance. High. Scraping targets mutate without notice, and the package has a single maintainer with no published SLA. Budget for a monitoring job that fails loudly on parse errors and a quarterly review of the upstream page. Assume you may need to fix the parser yourself; fork if the maintainer goes dormant.
Support. None beyond GitHub issues. Incident response is entirely yours. There is no vendor to escalate to when the site changes at 2 a.m., which is the opposite of the support posture most TPMs want for anything touching identity data.
Scaling. Not viable at volume. Throughput is bounded by IP reputation, captcha challenge rates, and target rate limits; each lookup is a synchronous HTTP round trip with multi-second latency. Realistic design is queue-based with strict throttling, aggressive caching of results by CPF (with retention limits), and hard concurrency caps — at which point the "free" package carries meaningful infrastructure and compliance overhead that may exceed the cost of a metered API.
Failure modes. Ranked by severity:
Ramp-up. Engineering ramp-up is low — a competent Laravel developer is productive in under a day. The real cost is organizational: compliance review, fallback provider contracting, monitoring, and on-call runbooks. Recommend a time-boxed spike with a written go/no-go that names the DPO sign-off as a hard gate.
How can I help you explore Laravel packages today?