/** * @param $book * @param $city */ protected function createAuthor($book, $city) { $author = new Models\Author(['name' => 'Author 1']); $author->save(); $author->books()->save($book); $author->city()->associate($city); $author->save(); }