We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
withAuthorInfo()
1 parent 451b656 commit 1eb42e2Copy full SHA for 1eb42e2
user_guide_src/source/guides/api/code/013.php
@@ -16,7 +16,7 @@ class BookModel extends Model
16
public function withAuthorInfo()
17
{
18
return $this
19
- ->select('book.*, author.id as author_id, author.name as author_name')
20
- ->join('author', 'book.author_id = author.id');
+ ->select('books.*, authors.name as author_name')
+ ->join('authors', 'books.author_id = authors.id');
21
}
22
0 commit comments