PHPackages                             escapework/laravel-asset-versioning - 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. [Caching](/categories/caching)
4. /
5. escapework/laravel-asset-versioning

Abandoned → [https://laravel.com/docs/7.x/mix](/?search=https%3A%2F%2Flaravel.com%2Fdocs%2F7.x%2Fmix)Library[Caching](/categories/caching)

escapework/laravel-asset-versioning
===================================

Package to help you avoid cache by versioning your assets

0.8.0(6y ago)4338.6k↓25%4MITPHPPHP &gt;=7.0.0

Since Feb 18Pushed 5y ago9 watchersCompare

[ Source](https://github.com/EscapeWork/laravel-asset-versioning)[ Packagist](https://packagist.org/packages/escapework/laravel-asset-versioning)[ RSS](/packages/escapework-laravel-asset-versioning/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (32)Used By (0)

Laravel - Assets Versioning
===========================

[](#laravel---assets-versioning)

[![Latest Stable Version](https://camo.githubusercontent.com/2f4dbe3d95dddc88376991bd4d17483ddd13fd891abee2ba589a59c2486a4cc5/68747470733a2f2f706f7365722e707567782e6f72672f657363617065776f726b2f6c61726176656c2d61737365742d76657273696f6e696e672f762f737461626c652e706e67)](https://packagist.org/packages/escapework/laravel-asset-versioning)[![Downloads](https://camo.githubusercontent.com/245a8cfbf6fbb2afc45dfcad798526e7c4c0fe9552edcc13123d93c7bd79db9f/68747470733a2f2f706f7365722e707567782e6f72672f657363617065776f726b2f6c61726176656c2d61737365742d76657273696f6e696e672f646f776e6c6f6164732e706e67)](https://packagist.org/packages/escapework/laravel-asset-versioning)[![Build Status](https://camo.githubusercontent.com/373970be4ccc92d487e2d5fe82bbfdf3c734b7ae0286e6fa8bc28b65e70e7951/68747470733a2f2f7472617669732d63692e6f72672f457363617065576f726b2f6c61726176656c2d61737365742d76657273696f6e696e672e706e67)](https://travis-ci.org/EscapeWork/laravel-asset-versioning)[![License MIT](https://camo.githubusercontent.com/9dd31f37587487be3076b3f537788248058eb8df4a7f8eb72ee9515853dc0ff1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f72636865737472612f7465737462656e63682e7376673f7374796c653d666c6174)](https://github.com/EscapeWork/laravel-asset-versioning)

**Disclaimer:** This package is not really maintained anymore, we recommend you use the Laravel Mix versioning instead.

Have you ever had a problem with cache in your assets? This package may help you.

Version Compatibility
---------------------

[](#version-compatibility)

LaravelLaravel Assets Versioning6.x/7.x/8.x0.8.x5.5+0.7.x5.4.x0.6.x5.3.x0.5.x5.2.x0.4.x5.1.x0.3.x5.0.x0.2.x4.2.x0.1.xInstallation
------------

[](#installation)

Via Composer:

```
$ composer require escapework/laravel-asset-versioning:"0.7.*"

```

And publish the configurations running the following command:

```
$ php artisan vendor:publish --provider="EscapeWork\Assets\AssetsServiceProvider"
```

Usage
-----

[](#usage)

Instead of using the `asset` helper, you will need to use the `Asset:v` method.

Imagine that your layout template has the following lines:

```

```

In your **local** environment, nothing changes. But in **production**, you just need to run the following command every time you need to update your assets' version:

```
$ php artisan asset:dist
```

And your layout will be rendered as this:

```

```

The version is the timestamp when you performed the `asset:dist` command.

This package knows which folder you need by the file extension, which is the array key in the config file.

You also can get only the path for some extension:

```
{{ Asset::path('css') }}

```

### HTTP2 Server Push

[](#http2-server-push)

You can also enable the HTTP2 Server Push header for all assets used with this package.

For that, you need to add the `HTTP2ServerPush` to the middlewares of your application.

```
protected $middleware = [
    \EscapeWork\Assets\Middleware\HTTP2ServerPush::class,
];
```

And that's it, your response will come with the `Link` HTTP header.

If you want to add some assets that are not versioned, you can use this method:

```
Asset::addHTTP2Link('/assets/fonts/robotto.woff', 'font');
Asset::addHTTP2Link('/assets/css/home.css', 'css');
Asset::addHTTP2Link('/assets/js/home.js', 'js');
```

Configurations
--------------

[](#configurations)

Of course you can configure the folders you need. Just edit the `config/assets.php` file, in the `types` array.

```
'types' => [
    'css' => [
        'origin_dir' => 'your-custom-css-dir/css',
        'dist_dir'   => 'your-custom-css-dir/dist',
    ],

    'js' => [
        'origin_dir' => 'your-custom-js-dir/js',
        'dist_dir'   => 'your-custom-js-dir/dist',
    ],

    'jpg' => [
        'origin_dir' => 'assets/images',
        'dist_dir'   => 'assets/images/dist',
    ],
],
```

You also can add more folders by adding more items into the array.

Also, you can configure in which environments the assets are gonna be versioned.

```
'environments' => ['production'],
```

### Changelog

[](#changelog)

See [Changelog](https://github.com/EscapeWork/laravel-asset-versioning/blob/master/changelog.md).

### Unit tests

[](#unit-tests)

Just run `vendor/bin/phpunit`.

License
-------

[](#license)

See the [License](https://github.com/EscapeWork/laravel-asset-versioning/blob/master/LICENSE) file.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

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

Every ~76 days

Recently: every ~273 days

Total

31

Last Release

2196d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.3.0

0.7.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/57e405b52d482c9de35b17f299d2745e8e68d9d9951aec64854f2d7fa53110bf?d=identicon)[luisdalmolin](/maintainers/luisdalmolin)

---

Top Contributors

[![luisdalmolin](https://avatars.githubusercontent.com/u/403446?v=4)](https://github.com/luisdalmolin "luisdalmolin (76 commits)")[![arseto](https://avatars.githubusercontent.com/u/14993730?v=4)](https://github.com/arseto "arseto (2 commits)")[![ehkasper](https://avatars.githubusercontent.com/u/988603?v=4)](https://github.com/ehkasper "ehkasper (2 commits)")

---

Tags

laravellaravel-5-packageversioning

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/escapework-laravel-asset-versioning/health.svg)

```
[![Health](https://phpackages.com/badges/escapework-laravel-asset-versioning/health.svg)](https://phpackages.com/packages/escapework-laravel-asset-versioning)
```

###  Alternatives

[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)[cheprasov/php-redis-client

Php client for Redis. It is a fast, fully-functional and user-friendly client for Redis, optimized for performance. RedisClient supports the latest versions of Redis starting from 2.6 to 6.0

1281.2M21](/packages/cheprasov-php-redis-client)[amphp/redis

Efficient asynchronous communication with Redis servers, enabling scalable and responsive data storage and retrieval.

165634.7k44](/packages/amphp-redis)

PHPackages © 2026

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