Skip to content

PHP/Laravel: routes inside Route::prefix()->group() produce no Route nodes #952

Description

@paolo-blocklabs

Version: 0.8.1 (linux-amd64-portable) · Language: PHP 8.4 / Laravel 12

Summary

Routes defined inside Route::prefix()->group() (the dominant pattern in production Laravel apps) produce no Route nodes. Flat definitions in the same file extract fine.

Repro

routes/api.php:

// extracts correctly → Route node __route__GET__/api/welcome
Route::get('/api/welcome', WelcomeController::class);

// produces NO Route nodes at all
Route::prefix('/users')->middleware(DomainCheckMiddleware::class)->group(function (): void {
    Route::get('/me', GetCurrentUserController::class);
    Route::post('/login', LoginUserController::class);
});

// nested prefixes also invisible
Route::prefix('companies/tenants/users')->group(function (): void { ... });

After index_repository (mode=full):

MATCH (n:Route) WHERE n.name CONTAINS 'users' RETURN n  → 0 rows

while the flat /api/welcome, /_test/* routes from the same file are present.

Impact

cross-repo-intelligence cannot match any caller to a Laravel service — in our 24-repo fleet (Go + PHP + TS) the pass returns cross_http_calls: 0 despite live FE→gateway traffic (GET /users/me). Since virtually all real Laravel apps group routes, PHP services are effectively invisible to cross-repo HTTP matching.

Same class of bug as #734 (Spring class-level @RequestMapping prefix dropped), but here the grouped routes are not merely missing their prefix — they are missing entirely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions