From ccb9874f63ff88a4d3a4f0b6f019ef3118aecdcb Mon Sep 17 00:00:00 2001 From: Alex <46262688+AlexRasch@users.noreply.github.com> Date: Sat, 21 Mar 2026 17:19:17 +0100 Subject: [PATCH] Fix: Update withAuthorInfo() to use plural table names The `BookModel::withAuthorInfo()` method in the Controller guide uses singular table names (book, author) instead of the plural names (books, authors) created in the Database Setup migration. Fixes #10057 --- user_guide_src/source/guides/api/code/013.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/guides/api/code/013.php b/user_guide_src/source/guides/api/code/013.php index d342cf4bfae9..9e8274d8a723 100644 --- a/user_guide_src/source/guides/api/code/013.php +++ b/user_guide_src/source/guides/api/code/013.php @@ -15,8 +15,8 @@ class BookModel extends Model */ public function withAuthorInfo() { - return $this - ->select('book.*, author.id as author_id, author.name as author_name') - ->join('author', 'book.author_id = author.id'); + return $this + ->select('books.*, authors.name as author_name') + ->join('authors', 'books.author_id = authors.id'); } }