Skip to content

Commit 40edd68

Browse files
Ingoring preventsLazyLoading when using Automatically Eager Loading (#55771)
1 parent 5a915b3 commit 40edd68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ public function getRelationValue($key)
562562
return $this->relations[$key];
563563
}
564564

565-
if ($this->preventsLazyLoading) {
565+
if ($this->preventsLazyLoading && ! self::isAutomaticallyEagerLoadingRelationships()) {
566566
$this->handleLazyLoadingViolation($key);
567567
}
568568

0 commit comments

Comments
 (0)