robertogallea / laravel-codicefiscale

Codice fiscale validation for php/laravel
MIT License
42 stars 16 forks source link

fake() - InvalidArgumentException: Unknown format "codiceFiscale" #65

Closed eleftrik closed 4 months ago

eleftrik commented 4 months ago

Everything works as expected when using $this->faker->codiceFiscale() (for example, in a factory).

However, when using fake()->codiceFiscale(), I get this error: InvalidArgumentException: Unknown format "codiceFiscale".

I was able to fix it by adding this line to a service provider (e.g. AppServiceProvider.php):

fake()->addProvider(app(CodiceFiscaleFakerProvider::class));

I didn't open a PR because the example in README.md uses fake(), so it could only be a problem related to my application.

Thanks

robertogallea commented 4 months ago

You were right and the readme was wrong ;) Thank you!

robertogallea commented 4 months ago

Fixed in v2.0.1

eleftrik commented 4 months ago

Thanks @robertogallea for this wonderful package!