diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php index 1cdf24375bb5..a208249f8281 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php @@ -519,6 +519,10 @@ protected function handleLazyLoadingViolation($key) return call_user_func(static::$lazyLoadingViolationCallback, $this, $key); } + if (!$this->exists || $this->wasRecentlyCreated) { + return; + } + throw new LazyLoadingViolationException($this, $key); }