add secured to URL automatically

This commit is contained in:
Djery-Tom 2022-12-06 10:47:04 +01:00
parent 6167c0b995
commit 6366c22e0f
2 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,10 @@ if (!function_exists('asset')) {
*/
function asset($path, $secured = false)
{
$appUrl = config('variables.app_url');
if (filter_var($appUrl, FILTER_VALIDATE_URL) !== false) {
$secured = str_contains($appUrl,'https');
}
return urlGenerator()->asset($path, $secured);
}
}

View File

@ -2,6 +2,7 @@
return [
'accepted_keys' => env('ACCEPTED_KEYS', ''),
'app_env' => env('APP_ENV', 'local'),
'app_url' => env('APP_URL', true),
'app_debug' => env('APP_DEBUG', true),
'swagger_docs_token' => env('SWAGGER_DOCS_TOKEN', true),
'receiver_name' => env('RECEIVER_NAME', 'iLink World'),