olssonm/swedish-entity
Validate and format Swedish organization numbers (organisationsnummer) in Laravel and PHP. Includes validation rules, helpers, and entity types to keep Swedish company data clean and accurate in your applications.
personnummer at form-submit time catches typos and fake inputs before they reach bank-ID or manual review, reducing failed verifications and support tickets.organisationsnummer validation for supplier records, marketplace seller verification, invoice recipient data, and CRM deduplication.YYYYMMDD-XXXX vs YYYYMMDDXXXX) at the boundary rather than downstream in reports and integrations.Consider it when:
Look elsewhere when:
Risk note to carry into the decision: low star count and apparent single-maintainer bus factor. Mitigate with an internal adapter interface, a pinned version, and a fork-ready posture — the code surface is small enough that this is cheap insurance.
To executives: This is a free, permissively licensed library that handles Swedish social-security and organisation-number validation — the fiddly checksum and formatting rules we would otherwise hand-build and maintain. It shortens time-to-market for Swedish onboarding, cuts form errors and downstream verification failures, and carries negligible cost. Risk is low because the scope is narrow and it can be swapped out behind our own interface if needed.
To engineering: A focused, single-responsibility package covering validation, formatting, and extraction for personnummer and organisationsnummer, including the edge cases teams usually get wrong. Recommended integration pattern is a thin domain wrapper — SwedishIdentityValidator or similar — so business logic never depends on the package directly. That gives us testability, a clean swap path, and a place to layer policy (masking, logging rules, age thresholds) on top.
To compliance/security: Adopting it does not change our data-handling obligations. It validates format only and performs no external calls; any extracted PII should still flow through existing retention and masking controls.
How can I help you explore Laravel packages today?