Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ciarlill's avatar

How to get the mix() function into Lumen?

I am building a very simple SPA, so decided to use Lumen instead of Laravel. However, I want to keep the front-end build process the same across all my lumen/laravel stuff. It was easy enough to grab the package.json file from a laravel project, create a webpack.mix.json file and get my builds working. However, I cannot use the mix() function in my view to load up cache-busted assets.

I found the mix function in the laravel source code under Illuminate\Foundation\helpers.php, but I am not sure how to properly get this code into my app. I would like to establish this as a dependency in a clean, reproducible way, rather than just grab that function and paste it into my app. This would allow me to re-use this more easily across future Lumen projects.

Any suggestions on how I might go about this? Thanks

0 likes
1 reply

Please or to participate in this conversation.