Answer the question
In order to leave comments, you need to log in
What could be the reason for the failure of the faker in the Factory from under the tests?
Good afternoon
I created a factory that works fine in seeders, but when you call it from tests, it works crookedly$this->faker:
class UserFactory extends Factory {
protected $model = User::class;
public function definition() {
return [
'name' => $this->faker->name,
...
UserFactory::new()->create()
// $faker = $this->faker;
$faker = \Faker\Factory::create();
app('hash')->make('secret')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question