¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -6,12 +6,13 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cookie;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
if (! function_exists('str_between')) {
if (!function_exists('str_between')) {
/**
* Get the portion of a string between the given values.
*
* @param string $subject
* @param string $search
*
* @return string
*/
function str_between($subject, $startsWith, $endsWith)
@@ -20,7 +21,7 @@ if (! function_exists('str_between')) {
}
}
if (! function_exists('locale')) {
if (!function_exists('locale')) {
/**
* Get current locale.
*
@@ -32,11 +33,12 @@ if (! function_exists('locale')) {
}
}
if (! function_exists('is_rtl')) {
if (!function_exists('is_rtl')) {
/**
* Determine if the given / current locale is RTL script.
*
* @param string|null $locale
*
* @return bool
*/
function is_rtl($locale = null)
@@ -45,7 +47,7 @@ if (! function_exists('is_rtl')) {
}
}
if (! function_exists('currency')) {
if (!function_exists('currency')) {
/**
* Get current currency.
*
@@ -59,7 +61,7 @@ if (! function_exists('currency')) {
$currency = Cookie::get('currency');
if (! in_array($currency, setting('supported_currencies'))) {
if (!in_array($currency, setting('supported_currencies'))) {
$currency = setting('default_currency');
}
@@ -67,7 +69,7 @@ if (! function_exists('currency')) {
}
}
if (! function_exists('supported_locales')) {
if (!function_exists('supported_locales')) {
/**
* Get all supported locales.
*
@@ -79,7 +81,7 @@ if (! function_exists('supported_locales')) {
}
}
if (! function_exists('supported_locale_keys')) {
if (!function_exists('supported_locale_keys')) {
/**
* Get all supported locale keys.
*
@@ -91,12 +93,13 @@ if (! function_exists('supported_locale_keys')) {
}
}
if (! function_exists('localized_url')) {
if (!function_exists('localized_url')) {
/**
* Returns an URL adapted to the given locale.
* Returns a URL adapted to the given locale.
*
* @param string $locale
* @param string $url
*
* @return string
*/
function localized_url($locale, $url = null)
@@ -105,11 +108,12 @@ if (! function_exists('localized_url')) {
}
}
if (! function_exists('non_localized_url')) {
if (!function_exists('non_localized_url')) {
/**
* It returns an URL without locale.
* It returns a URL without locale.
*
* @param string $url
*
* @return string
*/
function non_localized_url($url = null)
@@ -118,9 +122,9 @@ if (! function_exists('non_localized_url')) {
}
}
if (! function_exists('is_multilingual')) {
if (!function_exists('is_multilingual')) {
/**
* Determine if the app has multi language.
* Determine if the app has multi-language.
*
* @return bool
*/
@@ -130,7 +134,7 @@ if (! function_exists('is_multilingual')) {
}
}
if (! function_exists('is_multi_currency')) {
if (!function_exists('is_multi_currency')) {
/**
* Determine if the app has multi currency.
*
@@ -142,11 +146,12 @@ if (! function_exists('is_multi_currency')) {
}
}
if (! function_exists('is_module_enabled')) {
if (!function_exists('is_module_enabled')) {
/**
* Determine if the given module is enabled.
*
* @param string $module
*
* @return bool
*/
function is_module_enabled($module)
@@ -155,11 +160,12 @@ if (! function_exists('is_module_enabled')) {
}
}
if (! function_exists('is_core_module')) {
if (!function_exists('is_core_module')) {
/**
* Determine if the given module is core module.
*
* @param string $module
*
* @return bool
*/
function is_core_module($module)
@@ -168,7 +174,7 @@ if (! function_exists('is_core_module')) {
}
}
if (! function_exists('slugify')) {
if (!function_exists('slugify')) {
/**
* Generate a URL friendly "slug" from a given string
*
@@ -186,11 +192,12 @@ if (! function_exists('slugify')) {
}
}
if (! function_exists('v')) {
if (!function_exists('v')) {
/**
* Version a relative asset using the time its contents last changed.
*
* @param string $value
*
* @return string
*/
function v($path)
@@ -205,7 +212,7 @@ if (! function_exists('v')) {
}
}
if (! function_exists('fleetcart_version')) {
if (!function_exists('fleetcart_version')) {
/**
* Get the fleetcart version.
*
@@ -217,13 +224,14 @@ if (! function_exists('fleetcart_version')) {
}
}
if (! function_exists('old_json')) {
if (!function_exists('old_json')) {
/**
* Retrieve and json encode an old input item.
*
* @param string $array
* @param mixed $default
* @param mixed $options
*
* @return string
*/
function old_json($key, $default = [], $options = null)
@@ -234,12 +242,13 @@ if (! function_exists('old_json')) {
}
}
if (! function_exists('array_reset_index')) {
if (!function_exists('array_reset_index')) {
/**
* Reset numeric index of an array recursively.
*
* @param array $array
* @return array|\Illuminate\Support\Collection
*
* @return array|Collection
*
* @see https://stackoverflow.com/a/12399408/5736257
*/
@@ -263,11 +272,12 @@ if (! function_exists('array_reset_index')) {
}
}
if (! function_exists('html_attrs')) {
if (!function_exists('html_attrs')) {
/**
* Convert array to html attributes.
*
* @param array $attributes
*
* @return string
*/
function html_attrs(array $attributes)