Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Elixir Mix Bundle

Elixir Mix Bundle Laravel Package

iulyanp/elixir-mix-bundle

Symfony bundle integrating Laravel Mix asset handling: reads mix-manifest.json and exposes Twig/PHP helpers to resolve versioned, cache-busted asset paths, simplifying frontend asset management in Symfony applications.

View on GitHub
Deep Wiki
Context7

A Symfony bundle that integrates Laravel Mix

Frequently asked questions about Elixir Mix Bundle
How do I install iulyanp/elixir-mix-bundle in a Symfony application?
Install it with Composer using composer require iulyanp/elixir-mix-bundle, then register the bundle in config/bundles.php. Because the latest tagged release dates from June 2021, run composer why-not first to confirm the Symfony and PHP constraints still resolve against your target version. If the constraint conflicts, Composer will refuse the install cleanly rather than failing later at runtime.
How do I use the Mix helper inside a Twig template?
The bundle exposes a Twig helper that takes the unhashed asset path and returns the versioned path recorded in mix-manifest.json. You call it in place of a plain asset() call, for example when referencing the compiled CSS or JS entry point. The returned string already includes the cache-busting hash, so you can pass it straight into a script or link tag.
What is the difference between the Mix helper and the Elixir helper?
The Mix helper reads mix-manifest.json, which is produced by modern Laravel Mix builds. The Elixir helper reads the older Elixir revision manifest format produced by legacy Elixir versioning tasks. Choose the helper that matches how your frontend build writes its manifest file.
How do I configure the manifest path and public path?
The bundle is configurable, so you can point it at your own manifest file location and at the public directory that serves the compiled assets. Typical setups keep the manifest under public/ and the built files under public/build or public/js. Set these values in your bundle configuration so the helpers resolve paths correctly in both development and production.
Does this bundle work with Symfony 5, 6, or 7?
The most recent tagged release is v0.10.0 from June 2021, so it was written against Symfony versions from that era. It is unlikely to declare support for Symfony 6 or 7 without a maintenance release. Check the require block in its composer.json, or run composer why-not, before assuming compatibility with a current Symfony application.
How does cache busting work with Laravel Mix manifests?
When Mix builds for production it writes hashed filenames such as app.8f3c1a.js and records the mapping in mix-manifest.json. The bundle reads that mapping and rewrites the logical path from your template into the hashed path. Browsers and proxies then treat each new build as a distinct URL, avoiding stale cached assets after a deploy.
Can I resolve versioned asset paths in PHP instead of Twig?
Yes, the bundle is a Symfony service as well as a Twig extension, so you can inject it into a controller or service and call its lookup method directly. This is useful when building URLs in PHP code, in form types, or in mail templates rendered outside Twig. The result is the same hashed path the Twig helper would return.
Why does the helper throw an exception when an asset is missing from the manifest?
The helper fails loudly when the requested key does not exist in mix-manifest.json, which usually means the frontend build has not been run or the path was typed differently from the manifest entry. Regenerate the manifest with your production npm script, then verify the logical path matches the manifest key exactly, including leading slashes. Clearing the Symfony cache after changing configuration also helps.
Is this package maintained, and is it safe to use in production?
The latest tag is v0.10.0 from 18 June 2021, with an empty release-note body, and no newer release has been published. A pre-1.0 package that has missed several Symfony and PHP release cycles should be treated as dormant until proven otherwise. Run composer audit against a scratch install to see the transitive dependency exposure, and review the repository activity before adopting it.
What are the alternatives to elixir-mix-bundle for Symfony asset versioning?
symfony/webpack-encore-bundle is the mainstream option for Symfony frontend builds and asset versioning. Symfony's own asset component also ships a JSON manifest version strategy that reads a manifest file without any third-party bundle. If you specifically need Laravel Mix output, a small custom Twig extension reading mix-manifest.json is a low-risk alternative to an unmaintained dependency.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource