Last active
April 15, 2017 16:24
-
-
Save andrewdelprete/c9542043a0c5bb34388920d5eca74dd4 to your computer and use it in GitHub Desktop.
This file contains 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
// app/Http/Middleware/AssetUrls.js | |
// Middleware to load mix-manifest.json | |
// file Laravel Mix generates | |
class AssetUrls { | |
* handle (request, response, next) { | |
const View = use('View') | |
View.global('assetUrls', function () { | |
return require('../../../public/mix-manifest.json') | |
}) | |
yield next | |
} | |
} | |
module.exports = AssetUrls |
This file contains 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
<html> | |
<head> | |
<link href="{{ assetUrls()['/css/admin.css'] }}" rel='stylesheet' type='text/css'> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment