Back to the Learning!

Laracasts is packed full with over 1,000 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Published On Dec. 21st 2016

Whatcha Working On: Dynamic Asset Paths Using TDD

Episode 9 Run Time 18:29

Download
For this new version of Laravel Mix (the evolution of Laravel Elixir) that I'm working on, I need to create a single PHP function that can dynamically calculate the correct path to an asset, such as a script or stylesheet. This should work, regardless of whether hot reloading or file versioning have been enabled/requested. Let's knock it out together, using TDD.