PHPackages                             yakovlev-vladimir/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. yakovlev-vladimir/laravel-mix-twig-extension

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

yakovlev-vladimir/laravel-mix-twig-extension
============================================

Laravel Mix twig extension

03PHP

Since Jan 10Pushed 3y agoCompare

[ Source](https://github.com/yakovlev-vladimir/laravel-mix-twig-extension)[ Packagist](https://packagist.org/packages/yakovlev-vladimir/laravel-mix-twig-extension)[ RSS](/packages/yakovlev-vladimir-laravel-mix-twig-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)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;= 8.0 to use the library, but the latest stable version of PHP is recommended.

Install
-------

[](#install)

Install using Composer:

```
composer require yakovlev-vladimir/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 Yakovlev\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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 56.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/38f4b6b7a75fc2c51891ec63b86cd686caef8a5291595a3a87ce9d4592c57c5e?d=identicon)[merdoc](/maintainers/merdoc)

---

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)")[![yakovlev-vladimir](https://avatars.githubusercontent.com/u/689802?v=4)](https://github.com/yakovlev-vladimir "yakovlev-vladimir (6 commits)")

### Embed Badge

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

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

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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