xefi / faker-php-locales-fr-ca
Faker extension to include fr_CA locale
v1.0.1
2026-11-18 10:25 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
Canadian French (fr_CA) locale for Faker PHP.
Installation
composer require --dev xefi/faker-php-locales-fr-ca
The service provider is discovered automatically through Composer.
Usage
use Xefi\Faker\Faker; $faker = new Faker('fr_CA');
Generators without a fr_CA variant fall back to the default locale.
Locale-specific generators
| Method | Extension | Example |
|---|---|---|
province() / provinceCode() |
Address | Québec / QC |
postcode() |
Address | H2X 1K4 |
sin(bool $formatted = false) |
Person | 130 546 278 (Luhn check digit) |
businessNumber() |
Company | 123456782 (Luhn check digit) |
vat() |
Company | 123456782 RT0001 (GST/HST number) |
Canada does not use IBAN: iban() keeps the shape of the other locales with a Canadian account
(institution, transit and account numbers) behind a CA prefix.
Contributing
- Fork the repository and create a branch from
main. - Add an extension under
src/Extensions/and register it inFakerFrCaServiceProvider::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