How does Laravel find plural of models?

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

How Does Laravel Find the Plural of Models? Unpacking Eloquent Conventions

As developers working with Eloquent in Laravel, we often encounter a subtle but fundamental question: how does the framework map our singular Model names to their corresponding plural database table names? It seems simple—if I have a Dog model, the table is Dogs—but the reality of English grammar introduces complexity. Is there a master list of all English nouns, or does Laravel rely on something more robust?

This post dives deep into the conventions Laravel employs and how we manage database structure to ensure our Eloquent relationships are clean, predictable, and maintainable.

The Foundation: Eloquent Naming Conventions

At its core, Laravel’s Eloquent ORM operates primarily based on established naming conventions rather than complex linguistic analysis of English grammar. When you define a Model in PHP (e.g., class Dog extends Model), Eloquent follows a strict convention for mapping it to the database structure:

  1. Model Name: The singular, CamelCase name (Dog).
  2. Table Name: By default, Laravel assumes the corresponding table name is the pluralized, snake_case version of the model name (dogs).

This convention is robust for most standard nouns where adding an 's' suffices. This simple rule is often enforced during development setup and migration creation.

// Example Model definition
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Dog extends Model
{
    // Eloquent automatically assumes the table name is 'dogs'
}

This mechanism is crucial because it allows developers to write expressive PHP code without manually specifying table names everywhere. It promotes a high degree of abstraction, which is a core philosophy behind frameworks like Laravel.

The Challenge: Irregular Plurals and Real-World Data

The complexity arises when we move beyond simple additions of 's'. As you rightly pointed out, English has irregular plurals (e.g., Person becomes People, Child becomes Children). If Laravel strictly followed the rule of appending 's', it would incorrectly name a table Persons.

So, how does Laravel handle this? The answer lies not in linguistic guesswork, but in developer-defined structure and explicit mapping.

Laravel delegates the responsibility of accurate naming to the developer through two primary mechanisms: Database Migrations and Model Configuration.

1. Migration as the Source of Truth

The definitive source for table names is the database schema itself, defined within your migration files. When setting up a model, you are essentially defining the relationship between the application layer (Eloquent) and the persistence layer (SQL).

When creating a migration, you explicitly define the table name:

// Example Migration file
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePeopleTable extends Migration
{
    public function up()
    {
        Schema::create('people', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            // The table is explicitly named 'people'
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('people');
    }
}

In this scenario, the Model (Person) does not dictate the table name; the migration dictates it. Eloquent then simply adheres to whatever structure is defined in the database. This approach ensures that even irregular plurals like People are correctly handled because they exist as explicitly named tables, adhering to best practices promoted by Laravel development patterns.

2. Model Naming and Conventions (The Best Practice)

While explicit naming works perfectly fine, adhering to a consistent convention—where the table name is always the pluralized English noun—is highly recommended for maintainability. For instance, if you use Person in your code, you should define the migration as create_people_table. This consistency simplifies database management and makes it easier for other developers (or future you) to understand the structure immediately.

Conclusion: Convention Over Grammar

Laravel does not possess a comprehensive dictionary of English nouns; instead, it leverages convention over configuration. It relies on predictable patterns established by the developer—specifically through migrations and model definitions—to establish the link between the application layer and the database layer.

By treating database schema definition (migrations) as the source of truth, we bypass the need for Eloquent to perform complex grammatical analysis. This results in systems that are more flexible, explicit, and easier to debug. Always ensure your table names align with established pluralization rules, whether you use custom logic or rely on convention. For deeper insights into structuring your application using these powerful conventions, exploring resources from laravelcompany.com is highly recommended.