Laravel - Relationships - The Push Method

If you would like to save your model and all of its associated relationships, you may use the push method. In this example, the Post model will be saved as well as its comments and the comment's authors:

    
    $post = Post::find(1);
    
    $post->comments[0]->message = 'Message';
    $post->comments[0]->author->name = 'Author Name';
    
    $post->push();