Skip to content

Commit 7c659c5

Browse files
authored
Update helpers.php
Add portal helper
1 parent 387af06 commit 7c659c5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Diff for: src/helpers.php

+22
Original file line numberDiff line numberDiff line change
@@ -793,3 +793,25 @@ function format_currency($value, string $code = 'MVR', $locale = null): string
793793
], $locale);
794794
}
795795
}
796+
797+
if (! function_exists('current_portal')) {
798+
799+
function current_portal(): string
800+
{
801+
$host = RequestFacade::getHost();
802+
803+
return match ($host) {
804+
config('app.admin_domain') => 'admin',
805+
default => 'public',
806+
};
807+
808+
}
809+
}
810+
811+
if (! function_exists('is_admin_portal')) {
812+
813+
function is_admin_portal(): string
814+
{
815+
return current_portal() == 'admin';
816+
}
817+
}

0 commit comments

Comments
 (0)