sentry integration for n+1
This commit is contained in:
parent
15ebe1f20d
commit
e938e8436b
@ -43,9 +43,13 @@ class App extends Provider
|
|||||||
Model::preventLazyLoading(config('app.eager_load'));
|
Model::preventLazyLoading(config('app.eager_load'));
|
||||||
|
|
||||||
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
|
Model::handleLazyLoadingViolationUsing(function ($model, $relation) {
|
||||||
|
if (config('logging.default') == 'sentry') {
|
||||||
|
\Sentry\Laravel\Integration::lazyLoadingViolationReporter();
|
||||||
|
} else {
|
||||||
$class = get_class($model);
|
$class = get_class($model);
|
||||||
|
|
||||||
report("Attempted to lazy load [{$relation}] on model [{$class}].");
|
report("Attempted to lazy load [{$relation}] on model [{$class}].");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user