add locale manager
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user