📜  具有关系的 laravel 播种器 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:50.935000             🧑  作者: Mango

代码示例2
factory(User::class, 10)->create()->each(function ($user) {
    $user->posts()->saveMany(factory(Posts::class, 5)->make());
});