تخطَّ إلى المحتوى

Missing Query Tag (ARCH7057)

هذا المحتوى غير متوفر بلغتك بعد.

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.

<?php
$report = Order::where('status', 'pending')
->orderBy('created_at')
->get(); // unclear which code path in logs
<?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.