Inserting & Updating Related Models (The Create Method)
https://viblo.asia/p/eloquent-relationships-in-laravel-phan-3-MJykjmxyePB
$post = App\Post::find(1);
$comment = $post->comments()->create([
'message' => 'A new comment.',
]);PreviousInserting & Updating Related Models (The Save Method)NextInserting & Updating Related Models (Belongs To Relationships)
Last updated