I have a Laravel Factory named TagQuestionFactory which goes like this:
public function definition()
{
return [
'tag_id' => $this->faker->numberBetween(1,50),
'que_id' => $this->faker->numberBetween(1,50),
];
}
And in DatabaseSeeder, I added this:
public function run()
{
TagQuestionFactory::factory(50)->create();
}
Then I run php artisan db:seed but returns this error:
BadMethodCallException
Method DatabaseFactoriesTagQuestionFactory::factory does not exist.
So what’s going wrong here? How can I solve this issue?