Skip to content

ide.json: Routing

Overview

The routing section lets you extend Laravel Idea's routing support with custom route facade methods and additional middleware names.

routing.routeFacadeMethods

Registers custom methods that behave like Route::get(), Route::post(), etc. Laravel Idea will treat them as route registration calls and provide URL and controller action completions.

FieldRequiredDescription
nameYesMethod name (without a class prefix), e.g. "customGet".
urlIndexNo1-based parameter index that holds the URL/route path.
controllerIndexNo1-based parameter index that holds the controller action.
httpMethodNoHTTP verb for the route ("GET", "POST", etc.). Default: "GET".
json
{
    "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
    "routing": {
        "routeFacadeMethods": [
            {
                "name": "apiGet",
                "urlIndex": 1,
                "controllerIndex": 2,
                "httpMethod": "GET"
            },
            {
                "name": "apiPost",
                "urlIndex": 1,
                "controllerIndex": 2,
                "httpMethod": "POST"
            }
        ]
    }
}

With this configuration, Laravel Idea will provide controller action completion for apiGet('/users', [UserController::class, 'index']) and apiPost('/users', [UserController::class, 'store']). And these routes will be fetched in the "All Routes" view.

routing.additionalMiddleware

Registers extra middleware names that should appear in middleware completion — useful for middleware provided by packages or registered at runtime.

json
{
    "$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
    "routing": {
        "additionalMiddleware": [
            "tenant",
            "verified.phone"
        ]
    }
}

These names will be suggested wherever Laravel Idea completes middleware: Route::middleware(), the middleware array in route definitions, etc.