We now want Vuebnb to load any static assets from the CDN instead of the web server when in production. To do this, we're going to create our own Laravel helper method.
Currently, we reference assets in our app using the asset helper. This helper returns a fully-qualified URL for that asset's location on the web server. For example, in our app view we link to the JavaScript bundle file like this:
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
Our new helper, which we'll call cdn, will instead return a URL that points to the asset's location on the CDN:
<script type="text/javascript" src="{{ cdn('js/app.js') }}"></script>