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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
*/

View File

@ -60,7 +60,7 @@
<br />
<br />
<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>
@yield('content')
</div>