Created
November 2, 2018 12:25
-
-
Save jdltechworks/3a8c922bd3dfc68711adc51b806bb65f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\HtmlString; | |
if (! function_exists('react_assets')) { | |
function react_assets($path, $manifestDirectory = '') { | |
$manifestPath = public_path('assets-manifest.json'); | |
$files = array_reverse(json_decode(file_get_contents($manifestPath), true)); | |
$regex = '/(map|html)/'; | |
foreach ($files as $value) { | |
if(!preg_match($regex, $value)) { | |
print '<script src="'.$value.'"></script>'; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment