@@ -4,33 +4,33 @@ |
||
4 | 4 | // mix('js/app.js') |
5 | 5 | function mix($path, $json = false, $shouldHotReload = false) |
6 | 6 | { |
7 | - if (! $json) static $json; |
|
8 | - if (! $shouldHotReload) static $shouldHotReload; |
|
7 | + if (! $json) static $json; |
|
8 | + if (! $shouldHotReload) static $shouldHotReload; |
|
9 | 9 | |
10 | - if (! $json) { |
|
11 | - $manifestPath = public_path('manifest.json'); |
|
12 | - $shouldHotReload = file_exists(public_path('hot')); |
|
10 | + if (! $json) { |
|
11 | + $manifestPath = public_path('manifest.json'); |
|
12 | + $shouldHotReload = file_exists(public_path('hot')); |
|
13 | 13 | |
14 | - if (! file_exists($manifestPath)) { |
|
15 | - throw new Exception( |
|
16 | - 'The Laravel Mix manifest file does not exist. ' . |
|
17 | - 'Please run "npm run webpack" and try again.' |
|
18 | - ); |
|
19 | - } |
|
14 | + if (! file_exists($manifestPath)) { |
|
15 | + throw new Exception( |
|
16 | + 'The Laravel Mix manifest file does not exist. ' . |
|
17 | + 'Please run "npm run webpack" and try again.' |
|
18 | + ); |
|
19 | + } |
|
20 | 20 | |
21 | - $json = json_decode(file_get_contents($manifestPath), true); |
|
22 | - } |
|
21 | + $json = json_decode(file_get_contents($manifestPath), true); |
|
22 | + } |
|
23 | 23 | |
24 | - $path = pathinfo($path, PATHINFO_BASENAME); |
|
24 | + $path = pathinfo($path, PATHINFO_BASENAME); |
|
25 | 25 | |
26 | - if (! array_key_exists($path, $json)) { |
|
27 | - throw new Exception( |
|
28 | - 'Unknown file path. Please check your requested ' . |
|
29 | - 'webpack.mix.js output path, and try again.' |
|
30 | - ); |
|
31 | - } |
|
26 | + if (! array_key_exists($path, $json)) { |
|
27 | + throw new Exception( |
|
28 | + 'Unknown file path. Please check your requested ' . |
|
29 | + 'webpack.mix.js output path, and try again.' |
|
30 | + ); |
|
31 | + } |
|
32 | 32 | |
33 | - return $shouldHotReload |
|
34 | - ? "http://localhost:8080{$json[$path]}" |
|
35 | - : url($json[$path]); |
|
33 | + return $shouldHotReload |
|
34 | + ? "http://localhost:8080{$json[$path]}" |
|
35 | + : url($json[$path]); |
|
36 | 36 | } |