Get faker instance

4 years ago

d3v1

Creates an instance of the faker library to play around with. Useful if you are wondering what each of the faker methods do and want to examine the output or play with the results

Code

$faker = \Faker\Factory::create($locale ?? config('app.faker_locale', \Faker\Factory::DEFAULT_LOCALE));

$faker->sentence(15);

Output

=> "Quidem beatae laborum non deserunt at consequuntur voluptatem earum quia pariatur porro."
Video course: PHP Package Development