P
P
potapovdmtriy2015-07-03 20:43:29
Laravel
potapovdmtriy, 2015-07-03 20:43:29

How to use faker in laravel?

I installed faker, I use it like this

$faker = Faker\Factory::create();
$email = $faker->freeEmail;

installed via composer
, maybe something else needs to be connected?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2015-07-03
@potapovdmtriy

$faker = \Faker\Factory::create();

B
Barney_Gubmle, 2019-01-03
@Barney_Gubmle

You can connect at the top and in the code itself alreadyuse Faker\Factory as Faker;

$faker = Faker::create();
$email = $faker->freeEmail;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question