From bd351577eb8ccc5ebb4e48a8464c2564bd73bb33 Mon Sep 17 00:00:00 2001 From: Will Taylor-Jackson Date: Fri, 24 Sep 2021 15:59:59 +0100 Subject: [PATCH] fix: keep camel cased name except for `getMorphs` --- src/Eloquent/HybridRelations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Eloquent/HybridRelations.php b/src/Eloquent/HybridRelations.php index d3dcb9919..0818ca3ee 100644 --- a/src/Eloquent/HybridRelations.php +++ b/src/Eloquent/HybridRelations.php @@ -180,10 +180,10 @@ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null if ($name === null) { [$current, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); - $name = Str::snake($caller['function']); + $name = $caller['function']; } - [$type, $id] = $this->getMorphs($name, $type, $id); + [$type, $id] = $this->getMorphs(Str::snake($name), $type, $id); // If the type value is null it is probably safe to assume we're eager loading // the relationship. When that is the case we will pass in a dummy query as