Laravel Developers
Group for Laravel Developers - Beginners & Experienced.
32 Members
Join this group to post and comment.
19 Jan 2019

Laravel MIX mix() URLs Do Not Follow asset_url asset() In app/config.php

I'm facing an issue with Laravel mix() URLs not following the asset_url directive set in the main apps app/config.php setting. The asset_url informs Laravel about the path should be followed for the static assets like CSS, JS and Images. 

If you set the asset_url to your CDN, then Laravel should automatically convert the urls starting with asset() into the string starting with the specified address. 

The mix() method however is responsible for handling the cache busting. It looks into the mix_manifest file for every asset being loaded and then adds the unique timestamp to the asset path. So that when we do a production compiling; we always enforce the users to have the latest version of the file. 

Does anyone know how can we make use of the mix() urls's cache busting along with proper asset() urls? Would appreciate responses. THank you in advance.