Canadian French (fr_CA) locale for Faker PHP.
composer require --dev xefi/faker-php-locales-fr-caThe service provider is discovered automatically through Composer.
use Xefi\Faker\Faker;
$faker = new Faker('fr_CA');Generators without a fr_CA variant fall back to the default locale.
| 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.
- 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.
MIT