habier/versioning

This package is abandoned and no longer maintained. No replacement package was suggested.

Helpers to add version number to assets url

1.1 2019-03-16 14:56 UTC

This package is not auto-updated.

Last update: 2022-04-24 19:46:37 UTC


README

This package provides helpers and a config file to bust the client cache for your assets.
If you are using webpack or something similar, this is not needed.

Installation

composer require habier/versioning
php artisan vendor:publish --provider="Habier\Versioning\AssetVersioningServiceProvider"

After this, you will find a new config file called version.php in your config folder.
This config file holds your global app version.

Usage

<link href="{{ url_version('css/app.css') }}" rel="stylesheet">
<link href="{{ asset_version('css/app.css') }}" rel="stylesheet">

You can add specific version number too.

<link href="{{ url_version('css/app.css', 42) }}" rel="stylesheet">
<link href="{{ asset_version('css/app.css', 42) }}" rel="stylesheet">