$factory->define(App\Task::class, function (Faker\Generator $faker) {
return [
'user_id' => str_random(10),
'title' => $faker->text(16),
'intro' => $faker->text(50),
'nownum' => $faker->numberBetween(1,20),
'maxnum' => $faker->numberBetween(50,100),
'money' => $faker->numberBetween(100,500),
'mtype' => $faker->numberBetween(1,3),
'state' => $faker->numberBetween(1,2),
'endtime' => $faker->date(),
//'password' => bcrypt(str_random(10)),
//'remember_token' => str_random(10),
];
});
很奇怪的是$factory->define的define提示Method 'define' not found in class TheSeer\Autoload\Factory