From 8b4432d5d7130f164a069d9bbbd4434f5ff87ce0 Mon Sep 17 00:00:00 2001 From: Vladyslav Martynenko Date: Wed, 12 Feb 2025 23:08:29 +0200 Subject: [PATCH] chore: use already existing config object to call missingKeyCallback Use existing object instead of retrieving the same singleton object from container --- src/HasTranslations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HasTranslations.php b/src/HasTranslations.php index b52a5f7..c35f1a1 100644 --- a/src/HasTranslations.php +++ b/src/HasTranslations.php @@ -94,7 +94,7 @@ public function getTranslation(string $key, string $locale, bool $useFallbackLoc if ($isKeyMissingFromLocale && $translatableConfig->missingKeyCallback) { try { - $callbackReturnValue = (app(Translatable::class)->missingKeyCallback)($this, $key, $locale, $translation, $normalizedLocale); + $callbackReturnValue = ($translatableConfig->missingKeyCallback)($this, $key, $locale, $translation, $normalizedLocale); if (is_string($callbackReturnValue)) { $translation = $callbackReturnValue; }