Skip to content

ide.json: Eloquent

Overview

The eloquent section lets you customize how Laravel Idea understands your Eloquent models.

eloquent.modelTables

An array that maps Eloquent models to their database tables. Use it when Laravel Idea cannot calculate the correct table name for a model automatically — for example when a model resolves its table dynamically, or the naming does not follow Laravel's conventions.

Each entry overrides the calculated table name for the given model.

FieldRequiredDescription
modelYesFully qualified class name of the Eloquent model.
tableYesDatabase table name to use for this model, overriding the calculated value.
json
{
    "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
    "eloquent": {
        "modelTables": [
            {
                "model": "\\App\\Models\\User",
                "table": "custom_users"
            },
            {
                "model": "\\App\\Models\\Legacy\\Customer",
                "table": "tbl_customers"
            }
        ]
    }
}

With this configuration Laravel Idea uses the specified tables for those models when resolving fields, columns, and other database-aware completions.