users
id - integer
name - string
roles
id - integer
name - string
role_user
user_id - integer
role_id - integer
Suppose you have a Post model with a hasMany relationship with Comment. You may insert a Comment object related to a post by doing the following:
$post = Post::find(1);
$commentToAdd = new Comment(['message' => 'This is a comment.']);
$post->comments()->save($commentToAdd);