From f6878702d352f3f4c9697533f57adecb7245f4d8 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Wed, 28 Feb 2024 09:19:27 -0500 Subject: [PATCH] Avoid user resolve twice --- src/Auditable.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Auditable.php b/src/Auditable.php index e86ab748..51aeda76 100644 --- a/src/Auditable.php +++ b/src/Auditable.php @@ -416,8 +416,9 @@ public function preloadResolverData() { $this->preloadedResolverData = $this->runResolvers(); - if (!empty ($this->resolveUser())) { - $this->preloadedResolverData['user'] = $this->resolveUser(); + $user = $this->resolveUser(); + if (!empty ($user)) { + $this->preloadedResolverData['user'] = $user; } return $this;