Skip to content
/ sssn Public

Generates a valid Swedish social security number for Laravel.

License

Notifications You must be signed in to change notification settings

robbens/sssn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package will generate a valid Swedish social security number. It looks something like this: 790631-2629

Installation

composer require robbens\sssn

Usage

Generate a random date and identifier.

$validSsn = Sssn::make(); // 351220-6537

Specify a date and identifier manually.

$validSsn = Sssn::make('890525', '12'); // 890525-1206

Note: The identifier is 4 numbers. However, only the first two can actually be 0-99.

Specify a gender.

$validMaleSsn = Sssn::make('890525')->male(); // 890525-4473

$validFemaleSsn = Sssn::make('890525')->female(); // 8905257948

Validate.

Sssn::validate('8011036301'); // true

Sssn::validate('80/11/03-6301'); // true

Sssn::validate('801103-6302'); // false

How the ssn is generated

TODO

About

Generates a valid Swedish social security number for Laravel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages