Started work on subdirectory support

This commit is contained in:
Dan Brown
2016-08-13 17:56:20 +01:00
parent b157a9927a
commit baa260a03d
7 changed files with 32 additions and 21 deletions

View File

@ -20,11 +20,11 @@ if (!function_exists('versioned_asset')) {
}
if (isset($manifest[$file])) {
return '/' . $manifest[$file];
return baseUrl($manifest[$file]);
}
if (file_exists(public_path($file))) {
return '/' . $file;
return baseUrl($file);
}
throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
@ -62,6 +62,17 @@ function setting($key, $default = false)
return $settingService->get($key, $default);
}
/**
* Helper to create url's relative to the applications root path.
* @param $path
* @return string
*/
function baseUrl($path)
{
$path = trim($path, '/');
return rtrim(config('app.url'), '/') . '/' . $path;
}
/**
* Generate a url with multiple parameters for sorting purposes.
* Works out the logic to set the correct sorting direction