From f0719d4d8d226496787cd665b0a8bf962ef6e314 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Thu, 30 Jan 2020 11:06:51 -0500 Subject: [PATCH] Add a public_url() helper #513 (#519) --- app/helpers.php | 15 +++++++++++++++ .../views/system/errors/not_installed.blade.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/helpers.php b/app/helpers.php index ed3e1dd3..379fcc37 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -214,6 +214,21 @@ if (!function_exists('public_mix')) { } } +/** + * Wrap a call to url() and append the public folder before it + */ +if (!function_exists('public_url')) { + function public_url($path, array $parameters = []) + { + $publicBaseUrl = app()->publicUrlPath(); + $path = $publicBaseUrl.$path; + + $path = str_replace('//', '/', $path); + + return url($path, $parameters); + } +} + /* * Show a date/time in the proper timezone for a user */ diff --git a/resources/views/system/errors/not_installed.blade.php b/resources/views/system/errors/not_installed.blade.php index 88947ef2..5b9cac7f 100644 --- a/resources/views/system/errors/not_installed.blade.php +++ b/resources/views/system/errors/not_installed.blade.php @@ -60,7 +60,7 @@

- Head on to the installer > + Head on to the installer >

@yield('content')