add locale manager

This commit is contained in:
2024-03-27 13:56:52 +05:00
parent 7edca39546
commit 7443ff19d6
23 changed files with 845 additions and 497 deletions

View File

@@ -18,6 +18,23 @@ function isLocalIp(string $ip = ''): bool
return ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
}
/**
* Is turkmen ip
* @param string $ip
*/
function isTurkmenIp(string $ip = ''): bool
{
$patterns = ['95.85', '216'];
foreach ($patterns as $pattern) {
if (strpos($ip, $pattern) === 0) {
return true;
}
}
return false;
}
/**
* Un mask phone from "+(993)-xx-xx-xx-xx"
*/
@@ -138,3 +155,19 @@ function storeResourceEvent(string $name, array $data, Request $request): void
Log::error('Error in storeResourceEvent() helpers', ['error' => $e]);
}
}
/**
* Locale app path
*/
function localeAppPath(): string
{
return config('app.locale_app.path');
}
/**
* Locale app url
*/
function localeAppUrl(): string
{
return config('app.locale_app.url');
}