Search by

xefi / faker-php-locales-de-ch

martinsoenen

Faker extension to include de_CH locale

Package info

github.com/xefi/faker-php-locales-de-ch

pkg:composer/xefi/faker-php-locales-de-ch

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-11-18 10:25 UTC

This package is auto-updated.

Last update: 2026-11-18 11:07:59 UTC


README

Swiss German (de_CH) locale for Faker PHP.

Installation

composer require --dev xefi/faker-php-locales-de-ch

The service provider is discovered automatically through Composer.

Usage

use Xefi\Faker\Faker;

$faker = new Faker('de_CH');

Generators without a de_CH variant fall back to the default locale.

Locale-specific generators

Method Extension Example
province() / provinceCode() Address Zürich / ZH
avs(bool $formatted = false) Person 756.1234.5678.97 (EAN-13 check digit)
companyNumber() Company CHE-123.456.788 (UID, modulo 11 check digit)
vat() Company CHE-123.456.788 MWST
handelsregisternummer() Company CH-020.3.012.345-6
iban() Financial CH9300762011623852957

Contributing

  1. Fork the repository and create a branch from main.
  2. Add an extension under src/Extensions/ and register it in FakerDeChServiceProvider::boot().
  3. Add a test under tests/Unit/.
  4. Run the suite with vendor/bin/phpunit (or docker compose run php vendor/bin/phpunit).
  5. Open a pull request against main.

License

MIT