Skip to content

Commit

Permalink
Update helpers.php
Browse files Browse the repository at this point in the history
Add portal helper
  • Loading branch information
ibnnajjaar committed Apr 15, 2024
1 parent 387af06 commit 7c659c5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,3 +793,25 @@ function format_currency($value, string $code = 'MVR', $locale = null): string
], $locale);
}
}

if (! function_exists('current_portal')) {

function current_portal(): string
{
$host = RequestFacade::getHost();

return match ($host) {
config('app.admin_domain') => 'admin',
default => 'public',
};

}
}

if (! function_exists('is_admin_portal')) {

function is_admin_portal(): string
{
return current_portal() == 'admin';
}
}

0 comments on commit 7c659c5

Please sign in to comment.