xefi / faker-php-locales-da-dk
Faker extension to include da_DK locale
v1.0.1
2026-11-18 10:23 UTC
Requires
- php: ^8.3
- psr/container: ^2.0
- xefi/faker-php: ^1.5.3
Requires (Dev)
- phpunit/phpunit: ^11
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Danish (da_DK) locale for Faker PHP.
Installation
composer require --dev xefi/faker-php-locales-da-dk
The service provider is discovered automatically through Composer.
Usage
use Xefi\Faker\Faker; $faker = new Faker('da_DK'); $faker->name(); // "Freja Nielsen" $faker->fullAddress(); // "Vestergade 12, 8000 Aarhus" $faker->cpr(); // "0707614285"
Generators without a da_DK variant fall back to the default locale.
Locale-specific generators
| Method | Extension | Description |
|---|---|---|
region() |
Address | The 5 regions |
postcode() |
Address | 4 digits postnummer |
cpr(?string $gender, bool $formatted) |
Person | CPR number with a century-consistent 7th digit, passing the modulus 11 check |
companyNumber() |
Company | CVR number passing the modulus 11 check |
vat() |
Company | DK + CVR number |
iban() |
Financial | DK IBAN |
Contributing
- Fork the repository and create a branch from
main. - Add an extension under
src/Extensions/and register it inFakerDaDkServiceProvider::boot(). - Add a test under
tests/Unit/. - Run the suite with
vendor/bin/phpunit(ordocker compose run php vendor/bin/phpunit). - Open a pull request against
main.
License
MIT