PHPackages                             stormiix/laravel-mix-twig-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. stormiix/laravel-mix-twig-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

stormiix/laravel-mix-twig-extension
===================================

Laravel Mix twig extension

v1.0.0(9y ago)88.6k—0%4MITPHPPHP &gt;=5.5.9

Since Dec 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Stormiix/laravel-mix-twig-extension)[ Packagist](https://packagist.org/packages/stormiix/laravel-mix-twig-extension)[ RSS](/packages/stormiix-laravel-mix-twig-extension/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel-Mix Twig Extension
==========================

[](#laravel-mix-twig-extension)

[![GitHub stars](https://camo.githubusercontent.com/79bb3a95b14c9c410d4a1e5114e13e8b0da775f9ee1f325bd6fdd937c03e9362/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f53746f726d6969782f6c61726176656c2d6d69782d747769672d657874656e73696f6e2e737667)](https://github.com/Stormiix/laravel-mix-twig-extension/stargazers)[![GitHub forks](https://camo.githubusercontent.com/5d07a803dcfc560713bf6e147a9d397598ee7763183e138883e46b4ed400d69f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f53746f726d6969782f6c61726176656c2d6d69782d747769672d657874656e73696f6e2e7376673f7374796c653d666c6174)](https://github.com/Stormiix/laravel-mix-twig-extension/network)[![Build Status](https://camo.githubusercontent.com/370aed27746861c59b0c92c3eca34b69bd72e312aa53df25a4771a2f2be00699/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53746f726d6969782f6c61726176656c2d6d69782d747769672d657874656e73696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Stormiix/laravel-mix-twig-extension)[![Donations Badge](https://camo.githubusercontent.com/51b6870aa702255840b262406db76334eeedcc19777f5fe1b5040beacb0d806c/68747470733a2f2f73746f726d69782e636f2f646f6e6174652f696d616765732f62616467652e737667)](https://stormix.co/donate/)

The Laravel mix `version` task appends a unique hash to filename, allowing for cache-busting. For example, the generated file name will look something like: `all-16d570a7.css`.

In Laravel, you can use in your views the `mix()` function to load the appropriately hashed asset:

```

```

This twig extension is an adaptation of this `mix()` function.

Requirements
------------

[](#requirements)

You need PHP &gt;= 7.0 to use the library, but the latest stable version of PHP is recommended.

Install
-------

[](#install)

Install using Composer:

```
composer require stormiix/laravel-mix-twig-extension:dev-master
```

This will edit (or create) your composer.json file and automatically choose the most recent version.

Documentation \[TODO\]
----------------------

[](#documentation-todo)

### Register the extension

[](#register-the-extension)

```
use Stormiix\Twig\Extension\MixExtension;

$mix = new MixExtension(
    $publicDir,     // the absolute public directory
    $manifestName   // the manifest filename (default value is 'mix-manifest.json')
);
$twig->addExtension($mix);
```

### Register the extension as a Symfony Service

[](#register-the-extension-as-a-symfony-service)

Refer to the original repo.

### Using the Extension

[](#using-the-extension)

```

```

You can surround with the `asset` twig extension to make your application more portable:

```

```

Authors
-------

[](#authors)

- **Brieuc Thomas** - *Initial work* - [Elixir-twig-extension](https://github.com/brieucthomas/elixir-twig-extension)
- **Anas Mazouni** - [laravel-mix-twig-extension](https://github.com/Stormiix/laravel-mix-twig-extension)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dae8e0db476a0f0cda0cbcf1bcb30e265a306ee4490d94eab2160dac33e83fd?d=identicon)[Stormiix](/maintainers/Stormiix)

---

Top Contributors

[![Stormix](https://avatars.githubusercontent.com/u/18377687?v=4)](https://github.com/Stormix "Stormix (21 commits)")[![brieucthomas](https://avatars.githubusercontent.com/u/3427873?v=4)](https://github.com/brieucthomas "brieucthomas (10 commits)")

---

Tags

laravellaravel-mixphp7phpsymfonylaraveltwigextension

### Embed Badge

![Health badge](/badges/stormiix-laravel-mix-twig-extension/health.svg)

```
[![Health](https://phpackages.com/badges/stormiix-laravel-mix-twig-extension/health.svg)](https://phpackages.com/packages/stormiix-laravel-mix-twig-extension)
```

###  Alternatives

[tales-from-a-dev/twig-tailwind-extra

A Twig extension for Tailwind

36982.8k12](/packages/tales-from-a-dev-twig-tailwind-extra)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

261.9k](/packages/mati365-ckeditor5-symfony)[goetas/twital-bundle

Twital templating engine Symfony Bundle

206.8k](/packages/goetas-twital-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
