3 if (! function_exists('versioned_asset')) {
5 * Get the path to a versioned file.
10 * @throws \InvalidArgumentException
12 function versioned_asset($file)
14 static $manifest = null;
16 if (is_null($manifest)) {
17 $manifest = json_decode(file_get_contents(public_path('build/manifest.json')), true);
20 if (isset($manifest[$file])) {
21 return '/' . $manifest[$file];
24 if (file_exists(public_path($file))) {
28 throw new InvalidArgumentException("File {$file} not defined in asset manifest.");