Skip to content

Documentation inconsistency: singular vs plural table names in API guide #10057

@AlexRasch

Description

@AlexRasch

PHP Version

8.3

CodeIgniter4 Version

4.7

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

cli-server (PHP built-in webserver)

Environment

development

Database

Documentation inconsistency: singular vs plural table names in API guide

What happened?

Affected pages:

https://codeigniter.com/user_guide/guides/api/database-setup.html
https://codeigniter.com/user_guide/guides/api/controller.html

Description:

The API guide contains an inconsistency between the Database Setup page and the Controller page when referring to table names.
On the Database Setup page, the migrations create tables using plural names

However, on the Controller page, the withAuthorInfo() method in BookModel uses singular table names in both the select() and join():

public function withAuthorInfo()
{
    return $this
        ->select('book.*, author.name as author_name')
        ->join('author', 'book.author_id = author.id');
}

Steps to Reproduce

Follow the guide for rest api

Expected Output

Update the guide to use "correct" plural table names or update the migration =)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions