Add a public_url() helper #513 (#519)

This commit is contained in:
Nabeel S
2020-01-30 11:06:51 -05:00
committed by GitHub
parent f5bc087f38
commit f0719d4d8d
2 changed files with 16 additions and 1 deletions

View File

@@ -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 * Show a date/time in the proper timezone for a user
*/ */

View File

@@ -60,7 +60,7 @@
<br /> <br />
<br /> <br />
<p style="text-align: right; font-size: 22px;"> <p style="text-align: right; font-size: 22px;">
<a href="{{ url('/install') }}" class="btn btn-success">Head on to the installer ></a> <a href="{{ public_url('/install') }}" class="btn btn-success">Head on to the installer ></a>
</p> </p>
@yield('content') @yield('content')
</div> </div>