Download the PHP package elfsundae/laravel-asset-version without Composer
On this page you can find all versions of the php package elfsundae/laravel-asset-version. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elfsundae/laravel-asset-version
More information about elfsundae/laravel-asset-version
Files in elfsundae/laravel-asset-version
Package laravel-asset-version
Short Description Laravel static assets versioning via query string: `app.js` → `app.js?d41d8cd98f`
License MIT
Homepage https://github.com/ElfSundae/laravel-asset-version
Informations about the package laravel-asset-version
Laravel Asset Version
Laravel static assets versioning via query string: app.js
→ app.js?d41d8cd98f
.
Installation
For Lumen or earlier Laravel than v5.5, you need to register the service provider manually:
Configuration
First you need to create an asset version configuration file located at config/asset-version.php
, filled with assets paths. Or you may run the asset-version:update
artisan command to create this file:
Then you can run the asset-version:update
command to update the asset version configuration:
Now the configuration file might be:
:warning: You need to run the asset-version:update
command every time you changed any asset content. You may call this command in your assets build script, e.g. Laravel Elixir:
For Laravel Elixir, you can use
laravel-elixir-asset-version
NPM package to easily execute update.
Usage
You can get the versioned asset path using the asset_path()
helper function:
License
This package is open-sourced software licensed under the MIT License.