I have following tables:
Code:
document: id, name; author: id, name, job_title; document_author: document_id, author_id, position
Code:
$attributes = [name, job_title, position]; I'm trying to create author's model and attach it to document:
Code:
$author = \Author::create($attributes); \Document::find($id)->authors()