@brentxscholl you can take advantage of versioning using laravel mix, much easier and the same benefit.
Take a look here: https://laravel.com/docs/master/mix#versioning-and-cache-busting
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I was having an issue with browsers not loading new css styles after updating my css file (due to browser cache). I solved this by adding a version to css link. However, this is a bit annoying because every time I want to deploy changes to my server I have to update the css version so the user's browser loads the new changes.
Here is what I'm currently doing in the <head>:
<link href="{{ asset('css/main.css') }}?v=13" media="all" rel="stylesheet" type="text/css"/>
Every time I deploy new css I have to update the version to v=14 then v=15 then v=16 etc. so that it is always unique in my users browser.
Is there a way I can auto generate a version here? I was thinking maybe grabbing the date the file was updated and adding that as the version. that way it will always be unique, but I'm not sure how this can be done in Laravel blade.
How do you guys handle file caching and versions?
Thanks!
@brentxscholl you can take advantage of versioning using laravel mix, much easier and the same benefit.
Take a look here: https://laravel.com/docs/master/mix#versioning-and-cache-busting
Please or to participate in this conversation.