📅  最后修改于: 2022-03-11 14:57:42.638000             🧑  作者: Mango
You can save multiple models at once using the saveMany function:
$post = Post::find(1);
$post->comments()->saveMany([
new Comment(['message' => 'This a new comment']),
new Comment(['message' => 'Me too!']),
new Comment(['message' => 'Eloquent is awesome!'])
]);