Missing Query Tag (ARCH7057)
Ce contenu n’est pas encore disponible dans votre langue.
Key php.orm.missing-query-tag · Severity info · Category orm
Terminal ORM queries that carry no tag/comment for log/APM correlation make it hard to attribute slow-query logs to their source. Adding a query comment improves attribution.
Incorrect
Section titled “Incorrect”<?php$report = Order::where('status', 'pending') ->orderBy('created_at') ->get(); // unclear which code path in logsCorrect
Section titled “Correct”<?php$report = Order::where('status', 'pending') ->orderBy('created_at') ->withComment('OrderReport::pending') // query tag ->get();Attach a query tag/comment identifying the source to terminal queries.