Skip to content

Instantly share code, notes, and snippets.

@leben-jp
Created November 14, 2021 19:00
Show Gist options
  • Save leben-jp/d55ed85527231bdbbf533ac1e5097acb to your computer and use it in GitHub Desktop.
Save leben-jp/d55ed85527231bdbbf533ac1e5097acb to your computer and use it in GitHub Desktop.
$post = Post::find(1);
$post->comments()->saveMany([
new Comment(['message' => 'First comment']),
new Comment(['message' => 'Second comment']),
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment