factory初识数据
编写
$factory->define(App\Model\Admin::class, function (Faker\Generator $faker) {
static $password;
return [
'username' => $faker->name,
'password' => $password ?: $password = bcrypt('secret'),
];
});
执行:php artisan tinker