thebigk's avatar
Level 13

MIX Cache Bursting Vs. Asset URL Directive in Config

I'm on Laravel 5.7 and have decided to use the asset_url configuration in config/app.php. However, I also need to make use of the MIX's cache busting features for my static assets. I therefore define all the static assets as -

<link rel="stylesheet" type="text/css" href="{{mix('css/app.min.css')}}">

The problem is that mix() defaults the urls to /, totally ignoring the asset_url directive set in the config/app.php.

How do I get both?

0 likes
1 reply
Reached's avatar

Can't you just pull out the value from the asset_url helper and put it in front of the mix path? :)

mix(config('app.asset_url') . '/css/app.css')

Please or to participate in this conversation.