From f970647ea90f4c7053255526b487ff86602156de Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 18 Jul 2026 15:29:27 +0000 Subject: [PATCH] Sync DemoWorld specialty staff ownerEmailForStaff fix. Co-authored-by: Cursor --- app/Support/DemoWorld.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Support/DemoWorld.php b/app/Support/DemoWorld.php index 67469b6..40ccc29 100644 --- a/app/Support/DemoWorld.php +++ b/app/Support/DemoWorld.php @@ -585,9 +585,14 @@ final class DemoWorld public static function ownerEmailForStaff(?string $email): ?string { $email = strtolower(trim((string) $email)); - foreach (self::STAFF as $tier => $roster) { - foreach ($roster as $member) { - if (strtolower($member['email']) === $email) { + if ($email === '') { + return null; + } + + // Use staff() so dynamically appended specialty doctors resolve too. + foreach (['free', 'pro', 'enterprise'] as $tier) { + foreach (self::staff($tier) as $member) { + if (strtolower((string) $member['email']) === $email) { return self::ownerEmailForTier($tier); } }